import shutil
import os
os.mkdir('trash')
def isTrash(file):
return os.path.getsize(file) < 15
for f in os.listdir(path='.'):
if isTrash(f):
shutil.move(f, 'trash')
elif os.path.isfile(f):
print('file operation:' + f)
More than 1 year has passed since last update.
Register as a new user and use Qiita more conveniently
- You get articles that match your needs
- You can efficiently read back useful information
- You can use dark theme