I'm trying to run a system call from Python. I have a line that reads this in my Python script:
return os.system("crux tide-index")
crux is a program existing in my /home/ directory, and if I type the command crux tide-index into a terminal, it seems to work properly.
When I run my Python script, it reaches the line above and then outputs this line to stderr (i.e. it shows up in the output of my terminal):
sh: 1: crux not found
I don't understand why I can run the command in my terminal, but not in a Python script. Is there something I'm missing? Is the fact that crux is in my /home/ folder possibly the problem?
return os.system("/home/crux tide-index")?PATH, then call it from anywhere.crux tide-indexwon't actually work for something in your home directory, unless you've added your home directory to your PATH, or have an alias or shell function wrapping it. The alias approach seems likely -- a PATH update will be inherited by subprocesses (including Python), but an alias or non-exported shell function won't.*has actual literal meaning to a shell, putting it in your question title was a bit unclear.type cruxin your terminal?