Last active
August 29, 2015 14:28
-
-
Save 3rogue/10e74767be6e75f4a436 to your computer and use it in GitHub Desktop.
Revisions
-
3rogue revised this gist
Aug 25, 2015 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -12,4 +12,4 @@ def list_size(path): path = 'E:' with open ('1.txt','w') as f: for i in list_size(path): f.write(i[0]+'\t'+str(i[1])+'MB'+'\n') -
3rogue created this gist
Aug 25, 2015 .There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,15 @@ import os def list_size(path): res={} for dirpath, dirnames, filenames in os.walk(path): for name in filenames: fullpath = os.path.join(dirpath, name) size = os.path.getsize(fullpath) res[fullpath] = size/1024/1024 return sorted(res.items(), key = lambda d:d[1], reverse = True) path = 'E:' with open ('1.txt','w') as f: for i in list_size(path): f.write(i[0]+'\t'+str(i[1])+'\n')