【发布时间】:2016-11-14 19:52:56
【问题描述】:
您好,我想在 cmd 上读取 youtube dl 的输出并放入我的 wxpython 程序。这是我使用的功能。
def execute(self,command,textctrl):
process = subprocess.Popen(command, shell=True, stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
output = ''
# Poll process for new output until finished
for line in iter(process.stdout.readline, ""):
textctrl.AppendText(line)
output += line
process.wait()
exitCode = process.returncode
if (exitCode == 0):
return output
else:
raise Exception(command, exitCode, output)
wxpython 程序开始更新 textctrl 然后冻结。它没有更新 eta、大小、速度等
【问题讨论】:
-
你为什么不用youtube-dl API?
标签: python wxpython youtube-dl