argparse - How to handle ampersand as part a command line argument in python -




i have program in python 2.7 accepts command line parameters using argparse, if try enter string containing ampersand lose characters after ampersand.

for example:

i have simple python program test input of command line arguments , prints out entered single command line parameter.

essentially: print args.where

when run program argument this:

$ python args.py -a http://www.website.com?optionone=one&numbertwo=two 

the text printed screen is: http://www.website.com?optionone=one

i have similar results when using sys , printing using argv

how can full string entered?

this problem shell. put argument in quotes.





wiki

Comments

Popular posts from this blog

Asterisk AGI Python Script to Dialplan does not work -

python - Read npy file directly from S3 StreamingBody -

kotlin - Out-projected type in generic interface prohibits the use of metod with generic parameter -