I want to byte-compile a python library I use on an embedded device.
Basically, I want to preprocess all *.py
files to __pycache__/*.pyc
files to avoid that happening the first time this app is used and slowing everything down.
I'm trying to understand if this pre bytecode-translation step has any dependency on the place in which it run (my laptop vs another device).
If I byte-compile my python app with compileall on an Ubuntu box (x86-based) and then take those bytecode-translated files that get placed in a __pycache__
directory to an embedded linux box (ARM-based), will they work? Is byte-compiling platform specific?
I'm less concerned about whether .pyc
files are compatible with different versions of python as much as different underlying architectures. Both my machine and the device use python3.4.