Reading Time: 1 minutes
Getting size of a file on disk in Python: Using the stat() function of builtin module os, you can retrieve information about a file on disk, including its size in bytes.
Getting size of a file on disk in Python
import os |
info = os.stat( 'textOne.txt' ) |
print (info.st_size) # returns size of file in bytes |