Aug-28-2019, 12:02 AM
it turns out that sys.executable just always gives the engine path whether it was used in the command or not. there are 2 ways to run a Python script on POSIX. assuming the script is named "foo.py" and has been made executable with "chmod 755 foo.py". you can do "python3 foo.py" or "./foo.py". if "." is in the path list in the PATH environment variable then simply typing "foo.py" will also run it. what i am wanting is to determine whether the script was run directly or if the name or path to the engine was used. this could be difficult because hash-bang execution will still be running the engine and giving it the file path as the first argument and the typed arguments following that. so C level argv[] will look the same, either way. this is so i can re-run the script exactly the same way in a child process (i'm changing the arguments).
Tradition is peer pressure from dead people
What do you call someone who speaks three languages? Trilingual. Two languages? Bilingual. One language? American.
What do you call someone who speaks three languages? Trilingual. Two languages? Bilingual. One language? American.