6 ms·
You can do that with importlib too: from importlib.machinery import SourceFileLoader
by saila 7y ago
You can do that with importlib too:
from importlib.machinery import SourceFileLoader
- ChrisSD 7y agoThat's been deprecated as well. The current docs say you should do this spec = importlib.util.spec_from_file_location(module_name, file_path) module = importlib.util.module_from_spec(spec) spec.loader.exec_module(module) https://docs.python.org/3/library/importlib.html#importing-a-source-file-directly https://docs.python.org/3/library/importlib.html#importing-a...
- comex 7y agoGross...