When you click on an executable, there are two attributes which are important.
- the file has to be executable by the user
- the file type has to be recognized as executable
File permissions in Linux are in the form:
<owner><group><everyone>
To execute a file, it must be r-x
by the user to have the privileges.
The kind of executable file is also needed. This is declared by the file extension. Also, with script files in Linux you can declare the kind of file this is on the first line of the file.
Your declaration was:
#!/usr/bin/env python
This is not correct, it should point to the executable you want to use to compile and execute the code. #!/usr/bin/python
would be the correct declaration.