Build A Script In Python That Extracts Information Such as File Names, Size and File Dictionaries
First lets go over a few what is!
What is Python? Python is a computer programming language often used to build websites and software, automate tasks, and conduct data analysis.
What is IDE? An integrated development environment (IDE) is a software application that helps programmers develop software code efficiently. Some examples of popular IDE are AWS Cloud 9, NetBeans, Microsoft Visual Studio, Adobe Flex Builder, and Eclipse.
What is Python Dictionaries? Dictionaries are used to store data values in key:value pairs. A dictionary is a collection which is ordered*, changeable and do not allow duplicates.
What is Current Directories in Python? CWD is for current working directory in python. This returns the path of the current python directory as a string in Python.
Objectives:
Your company needs to learn about the files located on various machines. You have been asked to build a script that extracts information such as the name and size about the files in the current working directory and stores it in a list of dictionaries.
I will be creating a script to that generates a list of dictionaries about files in the working directory. Then print the list. Push code to GitHub.
Ok, lets start with opening up your IDE, I will be using AWS Cloud9, (please use the link below for instructions on how to set up AWS Cloud9. https://docs.aws.amazon.com/cloud9/latest/user-guide/setup-express.html), first you will need to name your file and save it, then open up command prompt so that you can run your script to see the output of your script. You will need to cd into your file to run the script.
As you can see this script prints out the name of the files, the size of the files and it dictionaries.
Once you get to this point you can push it to your GITHUB!
https://github.com/SharonRJohnson/Sharon-Gold-LUIT/blob/main/Python-Week13-project.py
Short and to the point!!!