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

西吉ssl適用于網(wǎng)站、小程序/APP、API接口等需要進(jìn)行數(shù)據(jù)傳輸應(yīng)用場(chǎng)景,ssl證書未來(lái)市場(chǎng)廣闊!成為創(chuàng)新互聯(lián)的ssl證書銷售渠道,可以享受市場(chǎng)價(jià)格4-6折優(yōu)惠!如果有意向歡迎電話聯(lián)系或者加微信:18982081108(備注:SSL證書合作)期待與您的合作!
相關(guān)推薦:《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‘
標(biāo)題名稱:創(chuàng)新互聯(lián)Python教程:Python如何調(diào)用rar命令
文章來(lái)源:http://www.5511xx.com/article/dhidogh.html


咨詢
建站咨詢
