[Tutor] Contents of Tutor digest, Help with hangman

Wayne Werner waynejwerner at gmail.com
Mon Jul 19 21:19:46 CEST 2010


On Mon, Jul 19, 2010 at 11:20 AM, John Palmer <speederpython at gmail.com>wrote:

> Thanks a lot for the help guys, but when I use the getpass.getpass(Enter
> your word here, I get a different response to what you get. This is what
> happen with mine:
>
> >>> import getpass
> >>> s = getpass.getpass("Enter your word here: ")
> Warning: Password input may be echoed.
> Please enter your secret word: hangman
>
> >>> s
> 'hangman'
> >>>
>
>
> I'm guessing that its something to do with the "Warning: Password may be
> echoed" line. In the documentation it says:
>
> "If echo free input is unavailable getpass() falls back to printing a
> warning message to stream and reading
> from sys.stdin and issuing a GetPassWarning."
> <snip copious amounts of irrelevant reply data>


What terminal emulator are you using? Whatever it is, apparently it doesn't
offer the ability to turn off echoing - or at least it doesn't report such
things. Though AFAIK, xterm, Eterm, and gnome-terminal all are fine with
that.

-Wayne
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/tutor/attachments/20100719/28334f3f/attachment.html>


More information about the Tutor mailing list