I'm tempted to have a go with mpy_cross to make a .pyc file for an ESP32. Decided to dry run the idea first since getting the cross compiler working on windows sounded complicated. I managed to make a .pyc of a simple 1 line print('hello world') program in IDLE.
Code: Select all
hello world
>>> import py_compile
>>> py_compile.compile('test.py')
'__pycache__\\test.cpython-39.pyc'
First thing I've learned is no repl will run a .pyc file. Is it fair to say that if I manage to get the cross compiler working, the only way to validate it would be to save the output as main.mpy, load it onto an ESP32 & hope for the best when I press reset?