-1

I was wondering : is there a way to compile a ".pyx" file (with Cython code) into a ".pyc" (thats works with windows and linux) : instead of : ".pyd" for Window or ".so" for Linux ?

I use the function cythonize.

Indeed, the ".pyc" works with both environnements : Linux and Windows.

I insist on this because I noticed my DLL ".pyd" and ".so" give minor and different results

Thank you

AdrienC
  • 59
  • 3
  • "Indeed, the ".pyc" works with both environments : Linux and Windows." This is **exactly why** it will not work: the **entire point** of using Cython is to create machine-specific code for performance reasons. "I insist on this because I noticed my DLL ".pyd" and ".so" give minor and different results" - then that is a separate problem that requires a proper [mre]. – Karl Knechtel Feb 13 '23 at 13:40

1 Answers1

1

No. .pyc files are Python bytecode files. They cannot contain the machine code Cython needs to produce to do its job.

user2357112
  • 260,549
  • 28
  • 431
  • 505