Answers for "how to get the size of a file without opening it python"

0

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')
Posted by: Guest on December-01-2020

Code answers related to "how to get the size of a file without opening it python"

Python Answers by Framework

Browse Popular Code Answers by Language