I recently added a number of examples on working with files and directories with Python and PyFilesystem.
The first example, is count_py.py which recursively sums up the number of bytes stored in a directory, and renders it in a "friendly" format.
This script takes a path or a URL. For instance python3 count_py.py ~/projects
will sum up the bytes of Python in your projects folder.
For me, this gives the following output:
This script accepts a path, but it will also work with any supported filesystem. So you could sum the bytes of Python in an archive or cloud server. continue reading…