So I have a shell script that requires something like
process_name --method POST --inputFile /path/to/file
Instead of the path to file, I can follow this answer and do something like:
process_name --method POST --inputFile <(echo "{\"param\":\"value\"}")
But when I try to do the same from python using:
shell_string = 'process_name --method POST --inputFile'
echo_val = '<(echo "{\"param\":\"value\"}")'
subprocess.Popen(shell_string.split() + [echo_val], stdout=subprocess.PIPE, stderr=subprocess.PIPE)
I get the following error:
FileNotFoundError: [Errno 2] No such file or directory: \'<(echo "{\\\\"param\\\\":\\\\"value\\\\"}")\'\n'
I'm assuming this has to do with appropriately escaping the quotes and backslashes but I can't quite figure out what it needs from me. Help is appreciated.
Thanks.