0
此代碼的工作,但終端窗口彈出(簡述):Python的子進程:如何隱藏終端窗口並仍然捕獲輸出?
print 'Trying wireless'
while True:
wlan = subprocess.Popen("netsh wlan connect name='BSD'", stdout = subprocess.PIPE, stderr = subprocess.PIPE)
out, error = wlan.communicate()
if out.find('success') >=0: break
print "Still trying wireless..."
time.sleep(0.5)
print "Connected!"
這是Python 2.7版在Windows 7
任何辦法阻止彈出窗口,並保持抓住輸出?
謝謝, 尼克。
你有沒有嘗試將父腳本保存爲'.pyw'? – jfs