Some of the packages in Python3 Getpass

Source: Internet
Author: User

The Getpass module provides the functions:

Getpass.getpass (prompt= ' Password: ', Stream=none)
Prompt the user for a password without echoing. The user is prompted using the string prompt, which defaults to ' Password: '. On Unix, the prompt are written to the File-like object stream using the Replace error handler if needed. Stream defaults to the controlling terminal (/dev/tty) or if that's unavailable to Sys.stderr (this argument is ignored O n Windows).

Exception Getpass. Getpasswarning?
A userwarning Subclass issued when password input is echoed.

Getpass.getuser ()
Return the "login name" of the user.

This function checks the environment variables LOGNAME, USER, LNAME and USERNAME, in order, and returns the value of the F Irst one which is set to a non-empty string. If None is set, the login name from the password database was returned on systems which support the PWD module, otherwise, An exception is raised.

In general, this function should is preferred over os.getlogin ().

Some of the packages in Python3 Getpass

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.