How to Get the Size of Directories in Python To run this: pip3 install -r requirements.txt To get the size of subdirectories of /root/home directory: python get_directory_size.py /root/home This will show a pie chart that indicates the size of each subdirectory.