how to read password from keyboard

B

Bruno Sousa

Hi everyone!

If I want to read a simple string from keyboard:
simple_text = gets

What if a password needs to be read from keyboard (commando line)?
How do I mask it with asterisks?

Regards,
Bruno
 
J

James Harrison

=20
If I want to read a simple string from keyboard:
simple_text =3D gets
=20
What if a password needs to be read from keyboard (commando line)?
How do I mask it with asterisks?


Try thinking of it like this:

every time a key is pressed on the keyboard, you want to:

print "*"

I don't have time right now to mock up an example, but that might get =
you started.=
 

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,780
Messages
2,569,611
Members
45,278
Latest member
BuzzDefenderpro

Latest Threads

Top