python - How can I prevent user entered password from showing on screen? -


this question has answer here:

i trying create utility program, after password correctly typed in goes main screen, , shows password right above it! there way can automatically make program clear shell before goes main menu?

you can use subprocess module execute "clear"(linux/mac) or "cls"(windows) command based on os.

>>> import subprocess,sys >>> if sys.platform in ("linux2", "linux", "darwin"): #for linux / mac ...     subprocess.call("clear") ... elif sys.platform.statswith("win"):    #for windows ...     subprocess.call("cls") 

list of possible sys.platform values:

system               platform value linux (2.x , 3.x)  'linux2' linux (py 3.3)       'linux' windows              'win32' windows/cygwin       'cygwin' mac os x             'darwin' os/2                 'os2' os/2 emx             'os2emx' riscos               'riscos' atheos               'atheos' 

Comments

Popular posts from this blog

Perl - how to grep a block of text from a file -

delphi - How to remove all the grips on a coolbar if I have several coolbands? -

javascript - Animating array of divs; only the final element is modified -