How to modify a program while it's running?

Joe Strout joe at strout.net
Tue Dec 16 15:25:17 EST 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?

Thanks,
- Joe






More information about the Python-list mailing list