Chinaunix首页 | 论坛 | 博客
  • 博客访问: 268958
  • 博文数量: 103
  • 博客积分: 0
  • 博客等级: 民兵
  • 技术积分: 705
  • 用 户 组: 普通用户
  • 注册时间: 2013-05-02 16:15
文章分类

全部博文(103)

文章存档

2014年(8)

2013年(95)

我的朋友

分类: Python/Ruby

2013-05-02 16:25:50


 from subprocess import call
import sys
import time
import os

 

source='test01'
target='test01'+time.strftime('%Y%m%d%H%M%S')+'.zip'
zip="zip"
arguments="-qvr"
cmd="%s %s %s %s "%(zip,arguments,target,source)

def zip():
    ret=call(cmd,shell=True)
    if ret!=0:
        print "zip faild!"
        sys.exit(1)
    else:
        print "success"
zip()

阅读(981) | 评论(0) | 转发(0) |
0

上一篇:没有了

下一篇:02-python-sync

给主人留下些什么吧!~~