This is for my test suite.
I have an automatically-generated Python package in a temporary folder. It's all .py
files. I want to programmatically compile these into (a) .pyc
and (b) .pyo
files. (One test will do .pyc
, another will do .pyo
.) This should be done with the active interpreter, of course. I do not want to import the modules, just compile.
How can I do this?