I am using linux mint, and to run a python file I have to type in the terminal: python [file path], so is there way to make the file executable, and make it run the python command automatically when I doublr click it?
And since I stopped dealing with windows ages ago, I wonder if the .py files there are also automatically executable or do I need some steps.
Thanks
You have to add a shebang. A shebang is the first line of the file. Its what the system is looking for in order to execute a file.
It should look like that :
or the real path
You should also check the file have the right to be execute.
chmod +x file.pyAs Fabian said, take a look to Wikipedia : Wikipedia – Shebang (en)