能力值:
( LV9,RANK:175 )
|
-
-
2 楼
if ( buf == ''): 改成 if not buf:
|
能力值:
( LV2,RANK:10 )
|
-
-
3 楼
如果是小文件 fp = open(filename , 'rb')
buf = fp . read()
fp . close() 如果是大文件
size = os . path . getsize(filename)
fp = open(filename , 'rb')
for i in range(0 , size , 1024 * 1024) :
buf = fp . read(1024 * 1024)
fp . close()
|
能力值:
( LV2,RANK:10 )
|
-
-
4 楼
老伙计
如果是小文件fp = open(filename , 'rb')
buf = ...
好的,我去学习一下。谢谢!
|
|
|