1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

password special character $ is not taking taking by argparser

Discussion in 'Python' started by sujan.dasmahapatra, Aug 26, 2013.

  1. sujan.dasmahapatra

    sujan.dasmahapatra Member

    Jun 11, 2009
    Likes Received:
    Trophy Points:
    I am trying to enter user name and password from command line. user name is 'rohit2010@gmail.com' and password is 'Lemon$319'.....When I am printing this values I can see the password is wrong. I am typing Lemon$319 but it is printing 'Lemon19'. $ and 3 are discarded.....Please help me what is going wrong.why it is not taking special character $?....Most of my passwords are having '$' sign. Please help.
    __author__ = 'sujan'
    import argparse
    import sys
    def main(argv):
        parser = argparse.ArgumentParser(description='Description of your program')
        parser.add_argument('-u', '--usr', help='UserName', required=True)
        parser.add_argument('-p', '--pswd',help='PassWord', required=True)
        args = vars(parser.parse_args())
        uname = args['usr']
        # code here
        password =  args['pswd']
        # code here
        if uname is None or password is None:
            print "User name - Password not valid"
            print uname
            print password
            print "calling program"
    if __name__ == "__main__":

Share This Page