Last active
September 20, 2018 15:34
-
-
Save darkmavis1980/8325f3bc838038e65e66ddd3ff6e3de2 to your computer and use it in GitHub Desktop.
Simple python test script to retrieve the files of the current directory
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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