7
Python 2 und 3, sind die Bytecode (pyo & pyc) abwärtskompatibel?Python 2 und 3, sind die Bytecode (pyo & pyc) abwärtskompatibel?
kann ich Python 2 Pyo & Pyc-Datei mit Python 3 ausführen?
Python 2 und 3, sind die Bytecode (pyo & pyc) abwärtskompatibel?Python 2 und 3, sind die Bytecode (pyo & pyc) abwärtskompatibel?
kann ich Python 2 Pyo & Pyc-Datei mit Python 3 ausführen?
Nein, sie sind normalerweise nicht einmal kompatibel zwischen Nebenversionen (z. B. 2,6 vs 2,7).
Da Sie jedoch normalerweise auch die .py-Dateien haben, kompiliert Python sie automatisch für die aktuell verwendete Version.
+1. Sie können eine interessante Antwort darüber finden, wie Python pyc-Dateien hier versioniert werden: http://stackoverflow.com/questions/514371/whats-the-bad-magic-number-error – ChristopheD
Sie sind ein Cpython-Implementierungsdetail, dass es? –