Using importlib to load compiled modules

Viewed 229

Module imp is deprecated as of Python 3.4, making imp.load_compiled("modname", "modpath") an unencouraged mechanism for loading byte code.

Is there an easy way to load a compiled module with importlib?

I am providing some code to students for an assignment and would prefer they not see it while working on the assignment. (I realize that they can reverse compile it.) I have browsed the importlib documentation and I suspect it is in there, but it is not obvious.

0 Answers
Related