Skip to content

Instantly share code, notes, and snippets.

@223n

223n/code.py

Created May 24, 2017
Embed
What would you like to do?
Python3で指定したフォルダのサイズをry
import os
def get_size(start_path = '.'):
total_size = 0
for dirpath, dirnames, filenames in os.walk(start_path):
for f in filenames:
fp = os.path.join(dirpath, f)
total_size += os.path.getsize(fp)
return total_size
print(get_size(start_path = '\\\\fileServer1\\documents'))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.