I'm using python's argparse module to get arguments from the command line and log in a website, for example: python app.py username password. However, I realized that some more complex passwords may include regular expressions such as '#' or '$', and the args.password will end up being either ignored or modified by the MacOS terminal: python app.py username #pa$$word.
parser = argparse.ArgumentParser()
parser.add_argument("username", help="website account username", type=str)
parser.add_argument("password", help="website account password", type=str)
args = parser.parse_args()
How can I avoid this behavior without having to hardcode these str arguments?
pscommand or equivalent.