如何使用Python控制unrar上的“ all OK”或所有消息?

时间:2018-11-11 21:43:21

标签: python unrar

我的代码是:

(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”或错误消息。

0 个答案:

没有答案