我的代码是:
(Unrar非免费版本)
#!/usr/bin python3.5
# -*- coding: utf-8 -*-
from glob import glob
import subprocess
dosyalar = glob("m18*.rar")
for dosya in dosyalar:
print(dosya)
bashCommand = "unrar e "+dosya+" -y -p1234"
process = subprocess.Popen(bashCommand.split(), stdout=subprocess.PIPE)
output, error = process.communicate()
print(output)
可以执行Unrar进程,但是我想控制该进程并保存日志,但是无法阅读“ All OK”或错误消息。