因此,我正在尝试使用shell输出实时更新QTextEdit
:
txtDirb = QTextEdit()
dirb_command = "dirb" + " " + url
p = subprocess.Popen([dirb_command], stdout=subprocess.PIPE, shell=True)
out = p.stdout.read()
txtDirb.append(str(out)) # buggy!
当然,这不会实时更新,而是等待整个命令执行,然后再填充QTextEdit
。有没有一种方法可以实现实时更新呢?
谢谢。