python获取文件大小

import os
from os.path import join,getsize

file_size = os.stat("D:/python开发代码/Python之路/作业/day8/sina.html")
huamn_readable_size=(file_size.st_size)/1024
print("此文件大小为%sk"%(huamn_readable_size))
原文地址:https://www.cnblogs.com/uglyliu/p/6122375.html