python中这个备份程序是怎么执行的啊,是哪句话调用了winrar啊

import os
import time
source = 'D:\\temp'
target_dir = 'D:\\Backup'
target = target_dir + os.sep + time.strftime('%Y%m%d%H%M%S') + '.zip'
if not os.path.exists(target_dir):
os.mkdir(target_dir)
zip_command = ('rar a {0} {1} '.format(target, ''.join(source)))
print('Zip command is:')
print(zip_command)
print('Running:')
if os.system(zip_command) == 0:
        print('Successful backup to', target)
else:
print('Backup FAILED')

import os
import time
source = 'D:\temp' #要打包的目录
target_dir = 'D:\Backup' #备份的目录
target = target_dir + os.sep + time.strftime('%Y%m%d%H%M%S') + '.zip' #备份文件目录名称 'D:\Backup\20170822174500.zip'
if not os.path.exists(target_dir): #判断目录是否存在
os.mkdir(target_dir) #不存在则先创建D:\Backup 文件夹
zip_command = ('rar a {0} {1} '.format(target, ''.join(source))) #拼压缩命令 rar a D:\Backup\20170822174500.zip D:\temp
print('Zip command is:')
print(zip_command)
print('Running:')
if os.system(zip_command) == 0: #这块执行真正的命令 os.system(args) 这个函数是python执行系统函数的接口,返回0表示执行成功,否则失败
print('Successful backup to', target)
else:
print('Backup FAILED')

望采纳!!!

这个就是命令行,它通过rar去触发了winrar

 zip_command = ('rar a {0} {1} '.format(target, ''.join(source)))