Hide raw_input text?

  • Thread starter Bruno Desthuilliers
  • Start date
B

Bruno Desthuilliers

tmallen a écrit :
I'm working on a little FTP project to get comfortable with ftplib.
It's all terminal-based right now, and one issue I'm having is hiding
password input text. I'd like one of two things to happen with this:
Either don't show any characters while I'm typing (like $ su), or
better, a '*' for every character. Is there a way to do this? I'm
planning on building this into a GUI tool using Tkinter or wxPython,
so methods using a secret input for those might be helpful as well ( I
could jump straight into the GUI part).

I think this kind of things is usually done using libs like readline.
 
T

tmallen

I'm working on a little FTP project to get comfortable with ftplib.
It's all terminal-based right now, and one issue I'm having is hiding
password input text. I'd like one of two things to happen with this:
Either don't show any characters while I'm typing (like $ su), or
better, a '*' for every character. Is there a way to do this? I'm
planning on building this into a GUI tool using Tkinter or wxPython,
so methods using a secret input for those might be helpful as well ( I
could jump straight into the GUI part).

Thanks!
 
F

Fredrik Lundh

tmallen said:
I'm working on a little FTP project to get comfortable with ftplib.
It's all terminal-based right now, and one issue I'm having is hiding
password input text. I'd like one of two things to happen with this:
Either don't show any characters while I'm typing (like $ su), or
better, a '*' for every character. Is there a way to do this? I'm
planning on building this into a GUI tool using Tkinter or wxPython,
so methods using a secret input for those might be helpful as well ( I
could jump straight into the GUI part).

for console input, use the getpass module:
Password:
'trustno1'

for GUI toolkits, the standard text entry widgets usually support
password input (e.g. using the show option in Tkinter, the wxTE_PASSWORD
style in wxPython, etc).

</F>
 
S

Support Desk

-----Original Message-----
From: tmallen [mailto:[email protected]]
Sent: Wednesday, August 13, 2008 12:26 PM
To: (e-mail address removed)
Subject: Hide raw_input text?

I'm working on a little FTP project to get comfortable with ftplib.
It's all terminal-based right now, and one issue I'm having is hiding
password input text. I'd like one of two things to happen with this:
Either don't show any characters while I'm typing (like $ su), or
better, a '*' for every character. Is there a way to do this? I'm
planning on building this into a GUI tool using Tkinter or wxPython,
so methods using a secret input for those might be helpful as well ( I
could jump straight into the GUI part).

Thanks!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,774
Messages
2,569,596
Members
45,135
Latest member
VeronaShap
Top