0

I have python file. If i run this file with python it takes 100 seconds to finish. If I run this python file with PyPy3 windows 32bit, it just takes 20 seconds. I will share my python file. So Is it possible to run this script with pypy in non installed pypy another computer without copy pypy folder? Is it possible to compile python file with pypy? Like Cython?

I am using right now like this;

os.system("C:\\pypy3\\pypy3.exe myPythonFile.py functionName parameters")

Thank you everyone :)

Emrexdy
  • 156
  • 1
  • 2
  • 8

1 Answers1

1

Pypy is an alternative Python interpreter (which internally uses a just-in-time compiler). It is not a compiler. Therefore it is not possible to compile a module to run through PyPy. Their FAQ has the question "Couldn’t the JIT dump and reload already-compiled machine code?", and the answer is "no".

It is also not possible to run individual modules in PyPy when the rest is using CPython. You either need to run your whole program in one or other other (or use system-calls as you're doing).

It does have the ability to translate RPython (a restricted subset of Python, where the restrictions are basically undocumented) to an executable, which is what it uses to build itself. This is not recommended..


In summary, what you're trying to do isn't possible and is nowhere near the purpose of PyPy.

DavidW
  • 29,336
  • 6
  • 55
  • 86