Movatterモバイル変換
[0]ホーム
Issues with getpass()
rawkawawkajmaris at ea.com
Thu Apr 26 14:21:56 EDT 2001
I was messing around with the sample that is included in the officialpython reference to telnetlib.Whenever I run the sample (included below), it gets hung up ongetpass() .. pythonwin freezes and I have to task slam it.I set up a breakpoint on the getpass line and stepped thru theresulting module code.The module detects my terminal fine (win98SE) but it gets stuck inthis loop (from getpass module):while 1: c = msvcrt.getch() if c == '\r' or c == '\n': break if c == '\003': raise KeyboardInterrupt if c == '\b': pw = pw[:-1] else: pw = pw + cIf I try to step over this, my app freezes.Anyhoot, can anyone help me with this? I am a durn fool idgit when itcomes to windows, wine, and women.Thank you.***Telnetlib sample:import getpassimport sysimport telnetlibHOST = "vdev03.kesmai.com"user = raw_input("Enter your remote account: ")password = getpass.getpass()tn = telnetlib.Telnet(HOST)tn.read_until("login: ")tn.write(user + "\n")if password: tn.read_until("Password: ") tn.write(password + "\n")tn.write("ls\n")tn.write("exit\n")print tn.read_all()
More information about the Python-listmailing list
[8]ページ先頭