To pass a string to python script using Linux/Unix Script parameters from datasource
Hello,
We have a python program which retrieve the customer send/receive details using a customer name, and we are using upload script option (Linux/Unix Script field) to execute the python program and its parameters are passing through a simple shellscript as below, Parameters we are trying to pass are Customer name and passcode
We are able to pass the customer name if it is a single word i.e SPU but if we try to pass the customer name with space inbetween i.e "SPU UPS" its not working. we have tried with Underscore inbetween i.e "SPU_UPS" its working, but we think underscore also passing as a value and not indicating space between the words while passing to the python script.
Could someone please provide a solution for passing the customer name with space as a parameter to the script. PFA

LM User
·3 years agoIt works on my Python datasources simply by putting the argument in quotes. I'm using argparse instead of sys.argv. Maybe that makes the difference?
You could move whatever might have spaces to the end, then parse your arguments from left to right, knowing that when you get to the Nth argument, everything after it should be joined back together: