Ivan
Ivan

Reputation: 64207

What can prevent a working (when "opened with" Python) Python application from starting by double-click?

A Python application (having a permission to be executed by the user) doesn't start with double click on it. If I run it (directly, by ./theapp.pyw) in terminal I get ": No such file or directory" error (while there is no such a string in the application code and the file surely exists (renaming it and using a different name results in the same)).

But If I explicitly open it with Python (by issuing python ./theapp.pyw or right-clicking and choosing to open with Python 2.7) it works just fine.

The first line of the file says

#!/usr/bin/env python

Issuing "/usr/bin/env python" command launches Python 2.7 console.

The OS is XUbuntu Linux 11.10. The only Python installed is Ubuntu's default 2.7.

Any ideas?

Upvotes: 3

Views: 100

Answers (1)

jdi
jdi

Reputation: 92577

pyw files are for windows http://filext.com/file-extension/PYW

And in windows the shebang line is ignored. Just work with the .py script.

You can also try creating a bash script that launches your python scripts with the specific flags that you want.

Upvotes: 3

Related Questions