I want to import foo-bar.py. This works:
foobar = __import__(\"foo-bar\")
This does not:
from \"foo-bar\" import * <
from \"foo-bar\" import *
If you can't rename the module to match Python naming conventions, create a new module to act as an intermediary:
---- foo_proxy.py ---- tmp = __import__('foo-bar') globals().update(vars(tmp)) ---- main.py ---- from foo_proxy import *