Skip to content

Commit 4fbcb68

Browse files
Merge pull request geekcomputers#122 from boksasp/master
Bugfix in folder_size.py. Remove indents in dictionary, and add *1024…
2 parents c15fdb5 + dc307f1 commit 4fbcb68

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

folder_size.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
# Description : This will scan the current directory and all subdirectories and display the size.
1010

1111
import os
12-
import sys ''' Load the library module and the sys module for the argument vector'''
12+
import sys # Load the library module and the sys module for the argument vector'''
1313
try:
1414
directory = sys.argv[1] # Set the variable directory to be the argument supplied by user.
1515
except IndexError:
@@ -19,8 +19,7 @@
1919
fsizedicr = {'Bytes': 1,
2020
'Kilobytes': float(1) / 1024,
2121
'Megabytes': float(1) / (1024 * 1024),
22-
'Gigabytes': float(1) / (1024 * 1024
23-
* 1024)}
22+
'Gigabytes': float(1) / (1024 * 1024 * 1024)}
2423
for (path, dirs, files) in os.walk(directory): # Walk through all the directories. For each iteration, os.walk returns the folders, subfolders and files in the dir.
2524
for file in files: # Get all the files
2625
filename = os.path.join(path, file)

0 commit comments

Comments
 (0)