Skip to content

Commit

Permalink
Merge pull request #1 from MLittlescp/dlittle-initial-branch-
Browse files Browse the repository at this point in the history
Create Python - Data Extraction Project.py
  • Loading branch information
MLittlescp committed Jun 28, 2024
2 parents aa64517 + 07bccb5 commit d4acf65
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions Python - Data Extraction Project.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# let's start off by importing operating systems
import os

# Get the list of files in the working directory
files = os.listdir()

# Create a list to store the file information
file_info_list = []

# Loop through the files and gather information
for file in files:
if os.path.isfile(file):
file_info = {
"name": file,
"size": os.path.getsize(file)
}
file_info_list.append(file_info)

# Print the list of dictionaries
print(file_info_list)

0 comments on commit d4acf65

Please sign in to comment.