python interpreter

Calvin Spealman ironfroggy at
Tue Aug 12 18:46:35 CEST 2008

The best answer is: Don't do that!

That isn't how you test things. Write test scripts, probably using the
unittest framework. You'll save yourself time and trouble having
easily reproducible tests. Many people suggested reload(), but you
should know it is dangerous. It can have results you don't expect and
are hard to track down. Unless you really, really know what you're
doing: dont use it.

On Tue, Aug 12, 2008 at 10:49 AM, Alexandru Mosoi <brtzsnr at> wrote:
> I'm using python's interpreter's to run various commands (like a
> normal shell). However if sources are modified changes are not
> reflected so I have to restart interpreter. Is there any way to avoid
> restarting this?
> example:
> import blah
> blah.Blah()
> # ... blah.Blah() changed
> blah.Blah()
> # ... new behavior
> --

Read my blog! I depend on your acceptance of my opinion! I am interesting!
Follow me if you're into that sort of thing:

More information about the Python-list mailing list