1
我只是一個初學者使用python 2.7。請原諒我的naive-內斯沒有名爲PXSSH的模塊
我下面的代碼是不工作
import sys
import os
import time
import re
import pxssh
a = ['192.168.50.11', '192.168.50.12']
for i in a:
Host = i
print Host
User = "xyz"
Password = "abc"
tn = pxssh.pxssh(Host)
tn.read_until("login as: ")
tn.write(User + "\n")
tn.read_until("Password: ")
tn.write(Password + "\n")
tn.read_until("#")
tn.write("show run\n")
time.sleep(3)
output = tn.read_all()
time.sleep(3)
f = open("C:/Python27/file/"+ Host + ".txt", "w+")
f.write(output)
f.close()
tn.close()
它給了我以下錯誤:
Traceback (most recent call last):
File "C:/Python27/backup_config_files", line 5, in <module>
import pxssh
ImportError: No module named pxssh
請讓我知道我可以解決與蟒蛇此pxssh模塊問題2.7 in windows