新聞中心
這里有您想知道的互聯(lián)網營銷解決方案
創(chuàng)新互聯(lián)Python教程:Python如何調用rar命令
通過os模塊的system()方法調用了系統(tǒng)的RAR.exe命令,這個方法會返回一個變量exit_status。

西吉ssl適用于網站、小程序/APP、API接口等需要進行數據傳輸應用場景,ssl證書未來市場廣闊!成為創(chuàng)新互聯(lián)的ssl證書銷售渠道,可以享受市場價格4-6折優(yōu)惠!如果有意向歡迎電話聯(lián)系或者加微信:18982081108(備注:SSL證書合作)期待與您的合作!
相關推薦:《python教程》
import os import time source = [r‘D:\Work\Python\Demo‘, ‘d:\\work\\linux‘] target_dir = ‘D:\\Work\\backup\\‘ target = target_dir + time.strftime(‘%Y%m%d%H%M%S‘) + ‘.rar‘ zip_command = "rar a %s %s" % (target, ‘ ‘.join(source)) if os.system(zip_command) == 0: print ‘Sucessful backup to‘, target else: print ‘Backup Failed‘
當前標題:創(chuàng)新互聯(lián)Python教程:Python如何調用rar命令
網頁URL:http://www.dlmjj.cn/article/dhidogh.html


咨詢
建站咨詢
