How to get the size of a file in Python

To get the size of a file in Python you can use the following snippet.
You can combine this snippet with How to format bytes to human readable Size in Python.

Sample Python

os.path.getsize(fileName)

Please Share us:
Please rate this snippet

One thought on “How to get the size of a file in Python

Leave a Reply