import imp
for k, v in list(globals().items()):
    if not (k.startswith('__') and k.endswith('__')):
        if isinstance(v, types.ModuleType):
            imp.reload(v)
How to batch reload the modules in Python?