2017-04-02 110 views
0
def oratab(ip, username,password): 
    # ip = '10.10.10.10' 
    # username = 'root' 
    # password = 'password' 
    remote_conn_pre = paramiko.SSHClient() 
    remote_conn_pre.set_missing_host_key_policy(paramiko.AutoAddPolicy()) 
    remote_conn_pre.connect(ip, username, password, look_for_keys=False, 
          allow_agent=False) 
    ... the function returns the files listing on Linux machine 

def reply(ip, username, password): 
    showinfo(title='Reply', message=list(oratab(ip, password, username))) 

top = Tk() 
Label(top, text='enter IP: ').pack() 
ent = Entry(top) 
ent.pack() 
Label(top, text='enter username: ').pack() 
ent2 = Entry(top) 
ent2.pack() 
Label(top, text='enter password: ').pack() 
ent3 = Entry(top) 
ent3.pack() 
btn = Button(top, text='Submit', command=(lambda: reply(ent.get(), ent2.get(), ent3.get()))) 
btn.pack() 
top.mainloop() 

> addrinfos = socket.getaddrinfo(hostname, port, socket.AF_UNSPEC, socket.SOCK_STREAM) 
> gaierror: [Errno 10109] getaddrinfo failed 

如果我通过IP只(DEF的oratab(IP)和高清回复(IP)),并指定用户名和密码上的oratab功能(只需在去除注释标记2行)它将返回正确的结果。errno的10109点的getaddrinfo失败返回

这是什么与我的拉姆达不采取第二个和第三个参数在tkinter窗口内:http://prntscr.com/erg1hs

回答

相关问题