代码: 全选
import os
import time
source = [r'C:\jor.txt',r'F:\MyWork']
targe_dir = r'F:\MyWork'
today = targe_dir + time.strftime('%Y%m%d')
now = time.strftime('%H%M%S')
if not os.path.exists(today):
print 'Successfully create dictionary',today
target = today + os.sep + now + '.zip'
zip_command="makecab %s %s "%("".join(source),target)
if os.system(zip_command) == 0:
print 'Successful backup to', target
else:
print 'Backup FAILED'
但是不知道为什么程序说找不到,弄了很久仍不得其解
求助!