SHOW:
|
|
- or go back to the newest paste.
| 1 | import os | |
| 2 | def get_size(start_path = '.'): | |
| 3 | total_size = 0 | |
| 4 | for dirpath, dirnames, filenames in os.walk(start_path): | |
| 5 | for f in filenames: | |
| 6 | fp = os.path.join(dirpath, f) | |
| 7 | total_size += os.path.getsize(fp) | |
| 8 | return total_size | |
| 9 | ||
| 10 | - | print get_size() |
| 10 | + | print(get_size()/1024/1024/1024) |