I have a shell script that calls a function from a python file that I created. That function needs two arguments, one string and one list of strings. I am trynig to figure out how can i call that script form the console. My scirpt is:
#!/bin/sh
cd $1
python -c "from my_file import my_function; my_function( \"$2\" )"
The first argument is the path of my_file.py while the second one is a python list of strings. How can I call the script from the terminal?
My script is working if I call it from a python file like (and have input two strings for example):
arguments = ["./script.sh", path, args1]
ret_val = subprocess.Popen(arguments, stdout=subprocess.PIPE)