How to modify a program while it's running?

Joe Strout joe at
Tue Dec 16 21:25:17 CET 2008

Here's my situation: I'm making an AIM bot, but the AIM server will  
get annoyed if you log in too frequently (and then lock you out for a  
while).  So my usual build-a-little, test-a-little methodology doesn't  
work too well.

So I'd like to restructure my app so that it can stay running and stay  
logged in, yet I can still update and reload at least most of the  
code.  But I'm not sure what's the best way to do this.  Should I move  
the reloadable code into its own module, and then when I give my bot a  
"reload" command, have it call reload on that module?  Will that work,  
and is there a better way?

- Joe

More information about the Python-list mailing list