How do you program in Python?

Peter Hansen peter at engcorp.com
Sun Jul 3 13:40:04 EDT 2005


anthonyberet wrote:
> What I would really like is something like an old-style BASIC 
> interpreter, in which I could list, modify and test-run sections of 
> code, to see the effects of tweaks, without having to save it each time, 
> or re-typing it over and over (I haven't even worked out how to cut and 
> paste effectively in the IDLE environment).

I do all my work using Scite (a nice free editor that was built to 
demonstrate the Scintilla plugin that can also be used in Python 
programs through things like the StructuredTextControl in wxPython), 
with the auto-save-on-loss-of-focus feature enabled, and a command 
prompt open in another window.

I edit in the Scite window, hit Alt-Tab (under Windows XP) to change 
focus to the cmd console (and instantly all my modified files are 
saved), press the Cursor Up key to retrieve the previous command (which 
is generally the name of my script, or a command like "python 
myscript.py"), and hit Enter to execute it.

So, any time I need to test the changes, I hit four keys (which at this 
point is understandably more like a "chord" that I hit without direct 
awareness of it) and I'm done.  Sounds pretty close to old-style BASIC 
and since I've come that route too (in the distant past), this may not 
be a coincidence.

-Peter



More information about the Python-list mailing list