Running a Python file

Jim Byrnes jf_byrnes at comcast.net
Wed Jul 7 02:08:37 UTC 2010


Pete Vander Giessen wrote:
> On Tue, Jul 6, 2010 at 5:36 PM, Jim Byrnes<jf_byrnes at comcast.net>  wrote:
>> I have been teaching myself Python.  Running some of my programs and
>> others examples I noticed that some I could run by double-clicking them
>> and others I could not.  Looking at the file permissions I saw that they
>> were different.  Then I noticed that all the ones I could not run were
>> ones I gone into Properties-->Permissions and check execute as a
>> program.  Once I unchecked it they worked.
>>
>> This seems backwards to me.  Could someone tell me why this works this way?
>
> Hi Jim,
>
> That _is_ backwards.  What do you mean by "run"?  The default behavior
> in Ubuntu, when you double-click an executable script, is to prompt
> whether you want to "display", cancel, or run the script.  The default
> behavior for a non-executable script is to open it up in your default
> text editor.
>
> I'm guessing that you are using an IDE to write your Python, and when
> you double click a non-executable file, it opens it up in the IDE, and
> then your IDE executes it.  When you double-click an executable file
> on the other hand, it is simply executing it and exiting, too fast for
> you to notice.  Does this sound plausible?

See my reply to Cameron.  I was thinking wrong.  I was thinking the 
script had to be executable instead of the python interpreater was 
executing the script.

> Regardless, have fun with Python.  It's an excellent language, and
> generally a pleasure to code.

That it is, I just program for my own enjoyment.

> ~PeteVG
>

regards,  Jim




More information about the ubuntu-users mailing list