On Nov 14, 11:04 am, Alan Baljeu <[EMAIL PROTECTED]> wrote: > I need a solution for automatically reloading files I edited. This is in a > unit testing/fixing context, so there shouldn't be much problem with leftover > data. I just need to be able to call a reload_changed() method of some sort > before rerunning tests. Stopping and restarting the python interpreter (it's > embedded) might be an option if (a) that's feasible within a process and (b) > it's quick. > > Alan Baljeuhttp://www.collaborative-systems.org > Intelligent software that works _with_ you. >
There's the "reload" builtin that you could use. In your method, just call reload on the modules you need reloaded. TurboGears somehow watches files for changes, so you might want to check out their source to see how it works. I'm sure it's something similar. Mike -- http://mail.python.org/mailman/listinfo/python-list