how do "real" python programmers work?

Mike Meyer mwm at mired.org
Thu Jan 12 19:50:48 EST 2006


"bblais" <bblais at gmail.com> writes:
> In Python, there seems to be a couple ways of doing things.   I could
> write it in one window, and from a Unix shell call
>                            python myscript.py
> and be like C++, but then I lose the interactiveness which makes
> prototyping easier.  If I use the python shell, I can use import (and
> reload), or execfile perhaps.
>
> How do experienced python programmers usually do it?

I do it both ways - and at least one other. If I'm working on code
that's largely independent of the module, I'll use python-mode's
"execute" commands to send the code to the Python interpreter. If the
code needs the rest of the module, I'll use reload in the interactive
interpreter. In the final stages of module development, I'll have a
test at the end of the module, and switch to the shell to run the
module as a script for testing.

Of course, a lot of what I do is web apps, so the later stages of
testing involve activating a browser and hitting "reload".

>  Is there a "usually" about it, or is it up to personal taste?  Are
> there any convenient ways of doing these things?

I think you've found some of the most convenient ones already. Maybe
some of the people who IDEs (instead of - well, we need a term for
development environment built out of Unix tools....) will let us know
what they do.

     <mike
-- 
Mike Meyer <mwm at mired.org>			http://www.mired.org/home/mwm/
Independent WWW/Perforce/FreeBSD/Unix consultant, email for more information.



More information about the Python-list mailing list