I've created a simple python script and therefor have a .py file. I can run it from the terminal but if I double click it only opens up in gedit. I've read this question other places and tried the solutions, however none have worked. I'm running Ubuntu 13.04, I've selected the box to make the file executable. I've even installed a fresh instance of Ubuntu 13.10 on another computer and it does the same thing. What might I be missing here?
In my case it works after includes at the first line:
#!/home/yourusername/anaconda3/bin/python
You can check the appropiate path running which python in your console.
It is also neccessary to change the file manager setting and configure it to run your scripts.
execute python script from linux desktop