
Print(folder + ' = ' + format(gigabytes, '.

file and click Open Containing Folder to view the folder that this file is listed. Gigabytes = convert_bytes_to_gigabytes(folder) Find out how your storage space is being used (CCleaner for Windows). If os.path.isdir(os.path.join(root_filepath, item)):įolders.append(, get_folder_size(item)])įolder_sizes = get_all_folder_sizes('C:\\') The recursion was much easier to implement.Īny and all suggestions are welcome! import os I know I could've invented some framework to keep track of all the folders previously scanned, but that seemed like a bit too monumental of an effort to make for such a trivial script. Also, efficiency was an issue with this script. Couldn't think of a way around it off hand, though. Is there anything I could have done better? I'm particularly displeased with the exception handling in the get_folder_size function, since I ended up handling the same exception twice, just at different levels. What about your situation makes you think tons of. I used this to identify bulky folders to find out where the problem was. However, the answers to both questions contain all the recent tree map type utilities that are in common use. A hard drive on one of my computers had just 6 GB left, so I needed to clean some space up. Click 'Computer' on the Start Menu (On Windows 8 open up 'File Explorer', and for Windows XP click 'My Computer' on the Start Menu) Look to the search bar in the top right corner of the window Type 'size:gigantic' and you'll be shown all files on your PC bigger than 128MB. I wrote this script a few days ago to find all files which were taking up over a certain threshold of memory on the hard drive.
