Skip to content

Instantly share code, notes, and snippets.

@reorx
Created July 16, 2012 17:29
Show Gist options
  • Save reorx/3123908 to your computer and use it in GitHub Desktop.
Save reorx/3123908 to your computer and use it in GitHub Desktop.
import os
def getflist(path):
fl = {}
for f in os.listdir(path):
fullname = os.path.join(path, f)
if not os.path.isfile(fullname):
continue
fl[f] = (os.path.getmtime(fullname),
int(os.path.getsize(fullname) / 1024))
return fl
if __name__ == '__main__':
print getflist(os.getcwd())
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment