I have a script called "submit.py" and it begins with "#!/usr/bin/env python.exe" which works if I'm inside the directory containing "submit.py". I can run "./submit.py" and the script runs properly. I decided to add the directory containing "submit.py" to my PATH environment variable so I can run "submit.py" from any directory.
However, I cannot run "submit.py" from any directory. The error I get is:
D:\Program Files\Python36\python.exe: can't open file '/mnt/d/Program Files/kattisTools/submitToKattis': [Errno 2] No such file or directory
I believe the error has to do with the differences in how Windows Python expects a path to be and how WSL handles paths. What I mean is python.exe should be looking for "D:\Program Files\kattisTools\submitToKattis" but WSL is feeding it "/mnt/d/Program Files/kattisTools/submitToKattis"
I also believe that "./submit.py" works when I'm inside the directory containing submit.py because the '.' operator is handled differently in WSL that feeds the real Windows path to Windows Python.
I was hoping there's a remedy so that I can run "submit.py" from any directory with it relying on Windows Python?
06/26/2018 Update: I have looked into Shared Environment Variables between WSL and Windows, and particularly the '/w' flag. I haven't gotten this to work the way I wanted yet but it might be something?