python interpreter

Calvin Spealman ironfroggy at gmail.com
Tue Aug 12 12:46:35 EDT 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 gmail.com> 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
> --
> http://mail.python.org/mailman/listinfo/python-list
>



-- 
Read my blog! I depend on your acceptance of my opinion! I am interesting!
http://techblog.ironfroggy.com/
Follow me if you're into that sort of thing: http://www.twitter.com/ironfroggy



More information about the Python-list mailing list