Python Program to find size of a file

 Python Program to find size of a file




In this example, you will learn how to find the size of a file using python.
In this we will be using os module.


import os

file_statics = os.stat('story.txt')
print(file_statics.st_size)
Output

56
Note that the unit of file size is byte.

If you like the content, share it in your social media platforms so that we can help the maximum. If you have any query then feel free to ask in the comments below.
We are ready to help you.
Enjoy Coding!!

For any doubts feel free to ask in comments below.
Stay Connected to Us for more such Courses and Projects.

Post a Comment

For any doubts feel free to ask in comments below.
Stay Connected to Us for more such Courses and Projects.

Post a Comment (0)

Previous Post Next Post