Lowell> import dbtest, util Lowell> for module in ['dbtest', 'util']: Lowell> if module in sys.modules.keys(): Lowell> reload(sys.modules[module])
Lowell> Is this the best way to do it? It seems a bit verbose, but not Lowell> really all that bad. I was just wondering if there is a more Lowell> standard way to do it? Not that I'm aware of. You don't need to request the keys() of a dict in recent versions of Python: import dbtest, util for module in ['dbtest', 'util']: if module in sys.modules: reload(sys.modules[module]) Also, since it's clear you have already imported dbtest and util, there's no need to check in sys.modules: import dbtest, util reload(dbtest) reload(util) Skip -- http://mail.python.org/mailman/listinfo/python-list