博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
PYTHON小CASE
阅读量:6989 次
发布时间:2019-06-27

本文共 509 字,大约阅读时间需要 1 分钟。

复制代码
import osimport timesource = ['C:\\py\\', 'C:\\work\\']target_dir = 'C:\\backup'today = target_dir + os.sep + time.strftime('%Y%m%d')now = time.strftime('%H%M%S')if not os.path.exists(today):    os.mkdir(today)    print('Successfully create directory', today)target = today + os.sep + now + '.rar'zip_command = 'C:\\"Program Files"\\WinRAR\\rar a {0} {1}'.format(target, ' '.join(source))print(zip_command)if  os.system(zip_command) == 0:    print('Successful backup.', target)else:    print('Backup FAILED.')
复制代码

转载地址:http://zfkvl.baihongyu.com/

你可能感兴趣的文章
计算机应用专业的学生应该掌握的IT技能
查看>>
MyEclipse 编写java mail 时遇到 java.lang.NoClassDefFoundError: com/sun/mail/util/LineInputStream...
查看>>
Spring Security 学习之LDAP认证
查看>>
c++适配器
查看>>
医院启用智能结构化电子病历
查看>>
Python发送各类邮件的主要方法
查看>>
nginx同一端口监听多个域名和同时监听http,https
查看>>
关于win7系统的设置文件共享与远程连接的步骤整理
查看>>
每天一个linux命令(11):nl命令
查看>>
Apache2.2+tomcat负载均衡session共享配置说明手册1.1版
查看>>
PHP 5.3.0以上推荐使用mysqlnd驱动
查看>>
vue.js中使用d3.js画家谱关系图
查看>>
python实现跨文件全局变量的方法
查看>>
grails的那个编码,老是忘记,记这里。。。。。
查看>>
禁用arcgis security service
查看>>
火狐ssl_error_weak_server_ephemeral_dh_key解决办法
查看>>
Exchange DAG error
查看>>
Windows7安全性的五件应该知道的事
查看>>
ON CONFLICT子句
查看>>
Delphi对保存数据库连接信息的Ini文件的操作类
查看>>