首页 > 代码库 > python编程快速上手之第9章实践项目参考答案(9.8.2)

python编程快速上手之第9章实践项目参考答案(9.8.2)

import os,shutil
sourcefolder=‘C:\\Users\\Administrator\\Python35-32‘
size=0
os.chdir(sourcefolder)

for folderName, subfolders, filenames in os.walk(sourcefolder):
  for item in filenames:
    size=os.path.getsize(os.path.join(folderName,item))
      if size>1024*1024*100:
        print (item)
       #send2trash.send2trash(os.path.join(folderName,item))

python编程快速上手之第9章实践项目参考答案(9.8.2)