Skip to content

Instantly share code, notes, and snippets.

@jjlumagbas
Created November 17, 2016 01:27
Show Gist options
  • Save jjlumagbas/40ac3e6cd568d81ebb83e9d5575004bc to your computer and use it in GitHub Desktop.
Save jjlumagbas/40ac3e6cd568d81ebb83e9d5575004bc to your computer and use it in GitHub Desktop.
Hide user input in Python
import getpass
age = getpass.getpass('Enter your age:')
print("Entered age is: " + age)
@milanb16
Copy link

This code works only in terminal.

@daviddsdp
Copy link

Thanks so much.

@javid-aliyev
Copy link

Cool thank you!

@PonnuGeorge
Copy link

Thank you

@odev954
Copy link

odev954 commented Jul 5, 2020

Thanks! :D

@voeb
Copy link

voeb commented Dec 12, 2020

Is there a way instead of hiding it to trasnform the input to this things: *

@odev954
Copy link

odev954 commented Dec 13, 2020

Hi @JoepTM

Is there a way instead of hiding it to trasnform the input to this things: *

You can give a try to stdiomask module.
Hope that will help! :)

@voeb
Copy link

voeb commented Dec 13, 2020

Hi @odev9654

You can give a try to stdiomask module.
Hope that will help! :)

thanks

@nobodyatall648
Copy link

nobodyatall648 commented May 16, 2021

Thanks!

@jatin633
Copy link

jatin633 commented Jul 8, 2021

thanks!

@Ehsan-lotfali
Copy link

thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment