Created
February 3, 2016 03:59
-
-
Save namnv609/f462c194e80ed4048cd2 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
import argparse, getpass | |
class Password(argparse.Action): | |
def __call__(self, parser, namespace, values, option_string): | |
if values is None: | |
values = getpass.getpass() | |
setattr(namespace, self.dest, values) | |
parser = argparse.ArgumentParser('Test password parser') | |
parser.add_argument('-p', action=Password, nargs='?', dest='password', help='Enter your password') | |
args = parser.parse_args() | |
print args.password |
Thank you for posting this, saved me some time.
Doesn't work and formatting is also wrong
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
hai please help me how to display information of sensors in the form of text in place of graphical represntation