byte code generated under linux ==> bad magic number underwindows

Fredrik Lundh fredrik at
Mon Dec 6 17:25:57 CET 2004

Aaron Bingham wrote:

> .pyc files are platform-independant but are incompatible between major Python versions.

"are incompatible" should be "may be incompatible"

you can use imp.get_magic() to get a string that identifies the bytecode version
supported by the current interpreter; any interpreter with the same string can run
your bytecode.


More information about the Python-list mailing list