Created
June 30, 2016 10:21
-
-
Save azhar22k/72bfad7e37df5059eea6ced2c1e7341c to your computer and use it in GitHub Desktop.
The following script tells the size of directory in which it is run. Tested on Unix but should also work with with Windows
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 | |
totalSize = 0 | |
for filename in os.listdir(os.getcwd()): | |
if not os.path.isfile(os.path.join(os.getcwd(),filename)): | |
continue | |
totalSize = totalSize + os.path.getsize(os.path.join(os.getcwd(),filename)) | |
print("Total Size of current working directory is {0:.2f} Kilo bytes".format(totalSize/1024)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The following script tells the size of directory in which it is run. Tested on Unix but should also work with with Windows