Created
July 30, 2019 12:07
-
-
Save zero-shubham/de47cfb332b9007950f6c4ae88d85f62 to your computer and use it in GitHub Desktop.
Revisions
-
zero-shubham revised this gist
Jul 30, 2019 . No changes.There are no files selected for viewing
-
zero-shubham created this gist
Jul 30, 2019 .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,12 @@ import os def recursive_dir_size(path): size = 0 for x in os.listdir(path): if not os.path.isdir(os.path.join(path,x)): size += os.stat(os.path.join(path,x)).st_size else: size += recursive_dir_size(os.path.join(path,x)) return size