python zip i/o error: invalid argument 运行提示下图错误
importosimporttimesource=['D:/py/m','D:/py/n']target_dir='D:/py/c/'target=target_dir+...
import os
import time
source = ['D:/py/m','D:/py/n']
target_dir = 'D:/py/c/'
target = target_dir + time.strftime('%Y%m%d%H%M%S') + '.zip'
zip_command = "zip -qr '%s' %s" % (target,' '.join(source))
if os.system(zip_command)==0:
print 'successful',target
else:
print 'backup failed' 展开
import time
source = ['D:/py/m','D:/py/n']
target_dir = 'D:/py/c/'
target = target_dir + time.strftime('%Y%m%d%H%M%S') + '.zip'
zip_command = "zip -qr '%s' %s" % (target,' '.join(source))
if os.system(zip_command)==0:
print 'successful',target
else:
print 'backup failed' 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询