programming-examples/python/Input_Output/Python program to get the file size of a plain file.py
2019-11-15 12:59:38 +01:00

6 lines
191 B
Python

def file_size(fname):
import os
statinfo = os.stat(fname)
return statinfo.st_size
print("File size in bytes of a plain file: ",file_size("test.txt"))