2
我使用telnetlib打印的最後一個命令後的輸出寫到服務器我可以清除Telnetlib輸出緩衝器上的Python 2.7
tn.write(cmd_login)
tn.write(cmd...)
tn.write(cmd_last)
print tn.expect([word],timeout)[-1]
然而,當我打印期望的回報,這也顯示我之前寫到服務器的結果(例如:cmd_login cmd ...) 反正只有在tn.write(cmd_last)之後纔打印結果嗎?