Skip to content

Instantly share code, notes, and snippets.

@darkmavis1980
Last active September 20, 2018 15:34
Show Gist options
  • Save darkmavis1980/8325f3bc838038e65e66ddd3ff6e3de2 to your computer and use it in GitHub Desktop.
Save darkmavis1980/8325f3bc838038e65e66ddd3ff6e3de2 to your computer and use it in GitHub Desktop.
Simple python test script to retrieve the files of the current directory
import os
path = os.curdir
files = os.listdir(path)
for file in files:
if os.path.isfile(path + file):
filesize = os.path.getsize(path + file)
print(f'- {file} - {filesize} Bytes')
else:
print(f'- {file}/')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment