[Tutor] Contents of Tutor digest, help with Hangman program

Steven D'Aprano steve at pearwood.info
Mon Jul 19 16:54:57 CEST 2010


On Mon, 19 Jul 2010 09:37:25 pm John Palmer wrote:
> Hi Alan thanks for the help. I did try the getpass module, I think I
> used:
>
> getpass.getpass()
>
> This actually prompted the user to enter a password, which isn't
> really what I want. Unless there's something i'm missing with this
> module? I'll take another look anyway.

Tell the function what prompt to use:

>>> import getpass
>>> s = getpass.getpass("Please enter your secret word: ")
Please enter your secret word:
>>> 
>>> print s
anti-disestablishmentarianism



-- 
Steven D'Aprano


More information about the Tutor mailing list