Closed kiransterling closed 3 years ago
This works on my (Linux) machine and in the test suite. Can you show me the entire block of code you're using? Are you running Python in an unusual environment like in IDLE or somewhere that's not a terminal?
I am running this from pycharm in windows. I also tried it in my ubuntu box . it didn't work. It works if I remove secure=True
from argparse_prompt import PromptParser
if name == 'main': parser = PromptParser() parser.add_argument('--username','-u', help='Your username') parser.add_argument('--password','-p', help='Your password',secure=True)
args = vars(parser.parse_args()) username=args['username'] password=args['password']
This works on my (Linux) machine and in the test suite. Can you show me the entire block of code you're using? Are you running Python in an unusual environment like in IDLE or somewhere that's not a terminal?
I am running this from pycharm in windows. I also tried it in my ubuntu box . it didn't work. It works if I remove secure=True
from argparse_prompt import PromptParser
if name == 'main': parser = PromptParser() parser.add_argument('--username','-u', help='Your username') parser.add_argument('--password','-p', help='Your password',secure=True)
args = vars(parser.parse_args()) username=args['username'] password=args['password']
I suspect this issue isn't related to ArgparsePrompt
, but rather the underlying getpass()
function. Try running getpass.getpass()
in your environment, and if it fails (as I suspect it will), that may direct you to solutions online, for example this.
If you're running it from PyCharm, then you're not running it from a terminal. I'm not surprised PyCharm has some issues with getpass()
.
I suspect this issue isn't related to
ArgparsePrompt
, but rather the underlyinggetpass()
function. Try runninggetpass.getpass()
in your environment, and if it fails (as I suspect it will), that may direct you to solutions online, for example this.If you're running it from PyCharm, then you're not running it from a terminal. I'm not surprised PyCharm has some issues with
getpass()
.
sorry to say it doesn't works from cmd as well
Please try out the other things I suggested. Please also describe what happens when it "doesn't work".
Closing for insufficient information
if I put
parser.add_argument('--password','-p', help='Your password',secure=True) it does not works. It does not even hides the password. Moreover if I press enter it hangs