当在 tkinter window 中输入参数时,Errno 10109 getaddrinfo 失败 returns
Errno 10109 getaddrinfo failed returns when params are entered within tkinter window
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) 和 def reply(IP))并在 oratab 函数上指定用户名和密码(只需删除 2 行中的注释登录),它将 return 正确的结果.
我的 lambda 有什么东西不带第二个和第三个参数在 tkinter 中吗 window: http://prntscr.com/erg1hs?
服务器似乎不可用。
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) 和 def reply(IP))并在 oratab 函数上指定用户名和密码(只需删除 2 行中的注释登录),它将 return 正确的结果.
我的 lambda 有什么东西不带第二个和第三个参数在 tkinter 中吗 window: http://prntscr.com/erg1hs?
服务器似乎不可用。