8000 GitHub - guoruibiao/getpass2: A better lib compared with standard 'getpass' in Python, easier and simpler to use.
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

guoruibiao/getpass2

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

getpass2

A better lib compared with standard 'getpass' in Python, easier and simpler to use.


How to install:

pip install getpass2

How to use:

Make sure you are in your console.

from getpass2 import getpass

And then the function getpass will return what you typed and show how many characters you have typed!

example

When the mode is 'n' means show numbers. You can see it as follows:

#coding:utf-8
import sys

from getpass2 import *

if __name__ == '__main__':
	print getpass(prompt='\bplease input your username(there should contains no space):', mode='n')
	

can delete chars and show current typed numbers of chars

#coding:utf-8
import sys

from getpass2 import *

if __name__ == '__main__':
    print getpass(prompt='\bplease input your username(there should contains no space):', mode='r', delimiter='*')

can delete chars and show replaced by customed delimiter

If something doesn't work, you can also copy the source named getpass2.py to your workspace. That will be OK!

Tips

You can custom your tip statement for the prompt parameter.

And most importantly, when you want to custom you tip parameter, remember to add a '%d' in it. That's really really important.

Finally, hope you can get happiness after using getpass2. Thank you!

About

A better lib compared with standard 'getpass' in Python, easier and simpler to use.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

0