Python Script Execution error while passing the string with space

Hi @keshav.asopa
If you want to pass named string arguments containing spaces in between to the python script, you can simply put the text in double quotes.

Example if you’re using argparse-

File Name - example.py

import argparse,sys

if __name__ == “__main__”:
parser = argparse.ArgumentParser(“Print String”)
parser.add_argument(’–input1’,’-i1’,type=str,help=“Manadatory Parameter”, required=True)
args = parser.parse_args()
print(args.input1)

Call this script by -
example.py -i1 “Hello World”
or
example.py --input1 “Hello World”