5

I'm trying to use Pypy to make my code run faster, but I don't know what to do with the zip file I downloaded from the site (I tried to read the directions but it moves too fast and I don't know what's going on). I was wondering if anyone had simple step by step instructions on how to install and use Pypy. Also, Im using Wing on Windows

mechanical_meat
  • 163,903
  • 24
  • 228
  • 223
user1998665
  • 81
  • 1
  • 5

1 Answers1

13

Unzip the zip file to a suitable location, e.g. C:\pypy then run pypy.exe from the folder to which you unzipped. There is no installation for pypy. Similarly to uninstall just delete the folder.

Running C:\pypy\pypy.exe gives you an interactive prompt, just like the one you get for running any other version of Python except it uses four chevrons >>>>.

To run a script with pypy you can explicitly name the interpreter:

C:\pypy\pypy.exe script.py

Or, if you have Python 3.3 installed on the same system, you can use the Windows Python launcher. Edit the ini file (%USERPROFILE%\AppData\Local\py.ini) with %USERPROFILE% replaced by your home folder name to contain:

[commands]
pypy=c:\pypy\pypy.exe

Then you can simply put a hashbang line at the start of any script and it will automatically run pypy when you run the script from a command line e.g. script.py, or when you click on its icon:

#!pypy
import sys
print(sys.version)

or use #!python27 to make a script run with Python 2.7, or #!python33 to make it run with Python 3.3.

Duncan
  • 92,073
  • 11
  • 122
  • 156