Python is easy?

Patrick Ellis pellis at tampabay.rr.com
Tue Aug 20 04:50:23 CEST 2002


"Bengt Richter" <bokr at oz.net> wrote:
> "Patrick Ellis" <pellis at tampabay.rr.com> wrote:
> >"Bengt Richter" <bokr at oz.net> wrote:
> >>    Run in Persistent Console
> >>       command
> >>          Data: cmd.exe /x /k D:\Python22\python.exe "%1"
> >
> >One thing to be careful of, the "open" option listed here is also used
> >when you type test1.py on the command line. The reason the .py is
> >required is so that it can lookup the file type. Changing it to the above
> >would result in a recursive invocation of cmd.exe whenever you ran
> >a Python script on the command line.
>
> Even Steve Holden's suggestion of python -i might not be ideal for default
open.

I never use the interactive prompt (just personal preference), so I
dismissed that option right away. I may add a right click option to try it
in the future.

> >What I'll try, when I get to work tomorrow, is make the new
> >Run in Persistent Console the default action (just a button click
> >in the file type window) and make sure the command line sticks
> >with open and not the new default action.
>
> Please post what you wind up doing.

Ok, you asked for it. I'm a little late, because Friday ended out being
moving day at work (musical cubicles to lower our productivity, while making
management feel good that they've solved a problem which didn't exist :-),
and my computer wasn't even plugged in most of the day. I tried making Run
in Persistent Console the default action, and it didn't change the behavior
of the command line. The command line must use whatever is defined for
"open" and not the default action. In the end though, I decided to do
something completely different....

I changed my default action to edit the .py file in my preferred editor. I'm
used to clicking on the .cpp and .h source code to edit it. Having python
execute, instead of edit, goes against my ingrained habits. I can't count
the number of times I accidentally ran a library module, when I just wanted
to view it. The default of edit makes it easier to browse through the source
of the various modules I'm using. As part of writing one script, I'll end up
looking at several modules. If I edit more than I execute, it makes sense to
me to making editing the easier option to do.





More information about the Python-list mailing list