import os
cwd = os.getcwd()
file_list = []
for filename in os.listdir(cwd): file_path = os.path.join(cwd, filename)
# Check if the file is a regular file (not a directory)
if os.path.isfile(file_path):
# Get the size of the file in bytes
file_size = os.path.getsize(file_path)
# Create a dictionary to store the file information
file_info = {
"path": filename,
"size": file_size
}
# Add the file information to the list
file_list.append(file_info)