python check file size in mb code example Example: python get file size in mb import os os.path.getsize("path/to/file") / (1024*1024)