• linkedu视频
  • 平面设计
  • 电脑入门
  • 操作系统
  • 办公应用
  • 电脑硬件
  • 动画设计
  • 3D设计
  • 网页设计
  • CAD设计
  • 影音处理
  • 数据库
  • 程序设计
  • 认证考试
  • 信息管理
  • 信息安全
菜单
linkedu.com
  • 网页制作
  • 数据库
  • 程序设计
  • 操作系统
  • CMS教程
  • 游戏攻略
  • 脚本语言
  • 平面设计
  • 软件教程
  • 网络安全
  • 电脑知识
  • 服务器
  • 视频教程
  • vbs
  • DOS/BAT
  • hta/htc
  • python
  • perl
  • VBA
  • ColdFusion
  • ruby
  • PowerShell
  • Lua
  • Golang
  • linux shell
您的位置:首页 > 脚本语言 >python > windows系统中python使用rar命令压缩多个文件夹示例

windows系统中python使用rar命令压缩多个文件夹示例

作者: 字体:[增加 减小] 来源:互联网

通过本文主要向大家介绍了windows7加密文件夹,c盘windows文件夹太大,windows文件夹太大,windows文件夹,windows字体文件夹等相关知识,希望对您有所帮助,也希望大家支持linkedu.com www.linkedu.com

import os
import time

# 1. The files and directories to be backed up are specified in a list.
#source=['/home/swaroop/byte','/home/swaroop/bin']
source=['D:\\FileCopier\\*.*','D:\\jeecms_doc\\*.*']
# If you are using Windows, use source=[r'C:\Documents',r'D:\Work'] or something like that

# 2. The backup must be stored in a main backup directory
#target_dir='/mnt/e/backup/' #Remember to change this to what you will be using
target_dir='E:\\temp\\' #Remember to change this to what you will be using

# 3. The files are backed up into a zip file
# 4. The name of the zip archive is the current date and time
target=target_dir+time.strftime('%Y%m%d%H%M%S')+'.zip'

# 5. We use the zip command (in Unix/Linux) to put the files in a zip archive
#zip_command="zip -qr '%s' %s" %(target,' '.join(source))
zip_command="rar a " + target + ' '.join(source)
# Run the backup
if os.system(zip_command)==0:
 print 'Successful backup to',target
else:
 print 'Backup FAILED'
</div>

</div>

您可能想查找下面的文章:

  • windows系统中python使用rar命令压缩多个文件夹示例
  • windows系统中python使用rar命令压缩多个文件夹示例

相关文章

  • Python Socket编程详细介绍
  • Python编写生成验证码的脚本的教程
  • Pycharm学习教程(7)虚拟机VM的配置教程
  • Python字符串转换成浮点数函数分享
  • 教你如何在Django 1.6中正确使用 Signal
  • Python类的动态修改的实例方法
  • Python中random模块生成随机数详解
  • Python获取DLL和EXE文件版本号的方法
  • Python中下划线的使用方法
  • Python自动化测试工具Splinter简介和使用实例

文章分类

  • vbs
  • DOS/BAT
  • hta/htc
  • python
  • perl
  • VBA
  • ColdFusion
  • ruby
  • PowerShell
  • Lua
  • Golang
  • linux shell

最近更新的内容

    • Python使用scrapy抓取网站sitemap信息的方法
    • 在Django中同时使用多个配置文件的方法
    • python检测远程服务器tcp端口的方法
    • 解读Django框架中的低层次缓存API
    • Python实现豆瓣图片下载的方法
    • 分享15个最受欢迎的Python开源框架
    • python数据结构之二叉树的遍历实例
    • TensorFlow实现打印每一层的输出
    • Python编程中的for循环语句学习教程
    • Django与遗留的数据库整合的方法指南

关于我们 - 联系我们 - 免责声明 - 网站地图

©2020-2025 All Rights Reserved. linkedu.com 版权所有