| | |
Masking a string input
![]() |
•
•
Join Date: Mar 2007
Posts: 6
Reputation:
Solved Threads: 0
Hi all, im gumster new to DaniWeb, been programming vb for numerous years moving to python anyway, Im trying to create a small authentication module for a program im making where it asks for the username and password, i was just wondering how i go about masking the password
so say for instance the password was "foo" when the user types on there keyboard all that is displayed is "***"?
Any help would be appreciated
so say for instance the password was "foo" when the user types on there keyboard all that is displayed is "***"?
Any help would be appreciated
•
•
Join Date: Apr 2006
Posts: 148
Reputation:
Solved Threads: 40
•
•
•
•
Hi all, im gumster new to DaniWeb, been programming vb for numerous years moving to python anyway, Im trying to create a small authentication module for a program im making where it asks for the username and password, i was just wondering how i go about masking the password
so say for instance the password was "foo" when the user types on there keyboard all that is displayed is "***"?
Any help would be appreciated
Python Syntax (Toggle Plain Text)
import getpass pswd = getpass.getpass("enter password: ") print pwd
•
•
Join Date: Apr 2006
Posts: 148
Reputation:
Solved Threads: 40
maybe you can try this . Not tested
Python Syntax (Toggle Plain Text)
def invisible(): key = '' passwd = '' max_char = 8 while 1 : key = msvcrt.getch() if key == '\r': break passwd = passwd + key if len(passwd) == max_char: break msvcrt.putch('*')
Last edited by ghostdog74; Mar 24th, 2007 at 3:21 am.
![]() |
Similar Threads
- user input into a string (C++)
- string input (Java)
- Use string input for enum (C++)
Other Threads in the Python Forum
- Previous Thread: Wrapping text in the IDE
- Next Thread: From phrase image
| Thread Tools | Search this Thread |
abrupt ansi anti apache approximation array assignment avogadro backend beginner binary bluetooth book builtin calculator character code converter countpasswordentry curved customdialog dan08 dictionaries dictionary dynamic examples exe file float format function gnu graphics gui heads homework ideas import inches input java launcher library line lines linux list lists loop mouse mysqlquery number numbers numeric output parsing path phonebook plugin pointer port prime programming progressbar projects py2exe pygame python random recursion redirect scrolledtext software statictext statistics string strings sum table terminal text textarea thread threading time tlapse trick tricks tuple tutorial twoup ubuntu unicode urllib urllib2 variable wordgame write wxpython xlib





