摘要: os.popen()功能强于os.system(),os.popen()可以返回回显的内容,以文件描述符返回。eg:1 #!/usr/bin/env python2 # -*- coding: UTF-8 -*-3 4 import os5 6 test = os.popen("ping www.baidu.com")7 print test.read() 阅读全文
posted @ 2013-05-06 18:20 烤串的_ 阅读(201) 评论(0) 推荐(0) 编辑
摘要: 今天接到一个小活,需要在打包平台中接一个小脚本。需要对*.exe安装包进行解压并对其解压后的文件进行数字签名认证。起初以为是多么easy的事情,结果在实际操作中发现通过使用import zipfile、import tarfile均宣告解压失败。不过发现7z到是可以解压,#!/usr/bin/env python# -*- coding: UTF-8 -*-import osimport sysdef Extract_File(filePath,target): """""" zip_command = r'C:\Progra 阅读全文
posted @ 2013-05-06 18:02 烤串的_ 阅读(2746) 评论(0) 推荐(0) 编辑