load.py 545 B

1234567891011121314151617181920212223242526
  1. import importlib
  2. def myload(modulename):
  3. # loader = importlib.util.find_spec(modulename)
  4. loader = importlib.find_loader(modulename)
  5. loader.load_module() # does a reload actually!
  6. m = importlib.__import__(modulename, globals(), locals())
  7. for v in dir(m):
  8. exec("global " + v + "; " + v + "= m." + v)
  9. def myloadmodules(modulenames):
  10. for name in modulenames:
  11. myload(name)
  12. def L():
  13. myloadmodules(["chromatic_texture_generator"])
  14. # "R"eload or "L"oad? Choose whichever is nicer to type.
  15. R = L
  16. L()