When I code in Python I use Sublime Text 3.
I've never really understood the #! (shebang) at the top of Python scripts.
One of my scripts wasn't running on Sublime because it had the auto build mode set to python3.9, while my dependencies were installed on Python3.10.
Instead of having to manually switch, I wanted to put a #! at the top of my script so every time it knows which interpreter to use (which version of Python to run).
After reading Should I put #! (shebang) in Python scripts, and what form should it take?, it seems to me like the point of a shebang is to run as an executable without having to give the python prefix while typing in the command, kind of like I'm trying to accomplish.
Im trying to run my file via . /path/to/file.py, but it's giving me zsh: permission denied:.
I am running Sublime 3 on macOS and my build system is
{"shell_cmd": ".../Versions/3.10/bin/python3 $file" }
How can I solve the permission issue zsh: permission denied? Is there a Sublime build that incorporates #!?