【发布时间】:2017-12-22 12:58:09
【问题描述】:
def wget_url(url):
try:
wget = subprocess.Popen(["wget "+url],shell=True,stdout=PIPE,stderr=PIPE)
return wget
except:
print("HTTP error")
a=wget_url(url)
a.stdout.readlines() #return an empty string.
a.stderr.readlines() #return the normal output that would be displayed in terminal
这正常吗?为什么 stdout 什么都不返回?
【问题讨论】:
标签: python python-3.x subprocess wget