how to get the size of a file without opening it python code example
Example: Python program to get the file size of a plain file.
import os
filepath='file1.txt'
size=os.path.getsize(filepath)
print(str(size) + ' Bytes')
import os
filepath='file1.txt'
size=os.path.getsize(filepath)
print(str(size) + ' Bytes')