[Tutor] Modifying Source Code while Program is Running
kent37 at tds.net
Thu Nov 24 14:32:41 CET 2005
Ed Singleton wrote:
> Is it feasible to change a program's source code whilst it is running
> without having to restart the program? Is it feasible to get a
> program to change it's own source code while it is running?
> For example, if you have a web server such as CherryPy that will
> (hopefully) be running for months at a time and you want to be able to
> change classes without having to restart the server. Or if you want
> to allow users of the site to edit a class through the web and see the
> changes to the site immediately?
This is hard. IIRC CherryPy has a way to automatically restart the server when a module changes, which is not what you ask for but at least it is automatic. A couple of recent threads on comp.lang.python have talked about this:
More information about the Tutor