Get File Size in Bytes using Python

os.path.getsize function

import os

sizeInBytes = os.path.getsize('test.txt')

print(sizeInBytes)

Leave a Comment

Cancel reply

Your email address will not be published.