How to modify a program while it's running?

Craig Allen callen314 at
Tue Dec 16 21:37:26 CET 2008

On Dec 16, 10:25 am, Joe Strout <j... at> wrote:
> 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

yes you want reload.  Design the high level part that knows how to log
in to be able to reload the stuff that changes.  My guess is that is
the best way, though I wouldn't be surprised if there are other

More information about the Python-list mailing list