Loading

Python 两种获取文件大小的方法

 

1 import os
2 r=os.path.getsize("/root/catbird1.stl")
3 f=open("/root/catbird1.stl","rb")
4 s=len(f.read())
5 print(r,s)

结果

1 6803519 6803519

 

posted @ 2016-08-15 13:53  王树燚  阅读(7380)  评论(0编辑  收藏  举报