Hi, Wanted to find what you think about reloading modules just before app start. This is to take care of repeated debugging sessions inside IDEs, where changed 'py' files are not imported automatically by the IDE.
One simple way of having everything reloaded is to do: import sys for mod in sys.modules.keys(): try: result = reload(__import__(mod)) except: pass the 'result' is string that gets returned from reload(). so we simply consume it and dont allow it to be sent to stdout, otherwise you will get a long print out of reloaded modules. reload() will throw exceptions when it cannot reload a module, but these are again silenced above. This snippet will allow reloading of all modules that have been loaded till this point. So it should be at the end of all module imports in your application...ideally just before the 'main' function is called in your app. Any views on this approach? Pros/Cons/Better Approaches... etc Best regards, Vishal Sapre --- Please DONT print this email, unless you really need to. Save Energy & Paper. Save the Earth. _______________________________________________ BangPypers mailing list BangPypers@python.org http://mail.python.org/mailman/listinfo/bangpypers