扫二维码与项目经理沟通
我们在微信上24小时期待你的声音
解答本文疑问/技术咨询/运营咨询/技术建议/互联网交流
如下所示:
source = ['C:\\Users\\admin\\Desktop\\pythonLearning'] target_dir = 'C:\\Users\\admin\\Desktop' print(time.strftime('%Y%m%d%H%M%S')) target = target_dir + os.sep + time.strftime('%Y%m%d%H%M%S') + '.zip' if not os.path.exists(target_dir): os.mkdir(target_dir) zip_command = 'HaoZipC a {0} {1}'.format(target, ' '.join(source)) type = sys.getfilesystemencoding() print('类型为:', type) print('Zip command is:') print(zip_command) print('Running:') result = os.system(zip_command) if result == 0: print('Successful backup to', target) else: print('Backup FAILED')
我们在微信上24小时期待你的声音
解答本文疑问/技术咨询/运营咨询/技术建议/互联网交流