I currently have a python script that takes multiple arguments, one of which happens to be a triple quoted string that are passed to script like so:
Script.py --FunctionArgs '"osPlatform='SUSE',osVersion=11"'
As you can see there are outer single quotations, with inner double quotes with a further pair of single quotations. It's vital that these inner single quotations stay when used in the script however when I print sys.args I get the following:
(FunctionArgs='"osPlatform=SUSE,osVersion=11"')
As you can see the inner quotes are stripped out. Due to the nature of the how the script is run I cannot do anything about the strange triple-quote formatting of the argument. Is there anyway I can get my Python script to not strip these inner quotes from the argument?
When the FunctionArgs
parameter doesn't have the outer single quotes (something I can't do anything about) it works fine and the inner single quotes are retained:
Script.py --FunctionArgs "osPlatform='SUSE',osVersion=11"
Results in
(FunctionArgs="osPlatform='SUSE',osVersion=11")