Reloading code without shutting down the app

Cameron Laird claird at starbase.neosoft.com
Tue Sep 24 23:56:11 CEST 2002


In article <3nipma.itu.ln at cvs>,
Max Ischenko  <max at malva.com.uaREMOVE.IT> wrote:
			.
			.
			.
>Does python have some ways to reload source code of already running
>modules? For example, when consumer recv. a SIGHUP it would delete
>currently used objects/classes/modules, import all again, creates objects
>and continues to process the data from the Queue.
>
>Is it possible? And how?
			.
			.
			.
The easy part is importing new stuff; read up on
eval and exec.

It takes more subtlety to "delete currently used
objects/classes/modules".  Easiest is to rewrite
your existing work slightly so it has enough self-
knowledge either to allow itself to be overwritten,
or to announce that it should be deleted.  Can you
make those changes?
-- 

Cameron Laird <Cameron at Lairds.com>
Business:  http://www.Phaseit.net
Personal:  http://phaseit.net/claird/home.html



More information about the Python-list mailing list