Thursday, May 14, 2009

Running Pyke in IronPython

Since easy_install does not work with IronPython (due to missing Gzip libraries), you need to run Pyke from the sources. This is easier than it seems.
- Unpack Pyke. Resulting directory is something like pike_1.0.2
- Since IronPyton does not have a native implementation of the subprocess module, Get subprocess.py from: http://bitbucket.org/jdhardy/code/raw/8bfe4cffece2/subprocess.py and copy it to the pyke-1.0.2\pyke directory
- Start IronPython from the comman dline, while pyke-1.0.2 is the active directory:
○ c:\pyke_1.0.2>ipy.exe
- Type: import pyke

So, to recap, here is how you would run the towers of hanoi example:

c:\>cd pike-1.0.2
c:\pike-1.0.2>ipy.exe
IronPython 2.0 (2.0.0.0) on .NET 2.0.50727.3053
Type "help", "copyright", "credits" or "license" for more information.
>>> import pyke
>>> from examples.towers_of_hanoi import test
>>> test.test(1)
got 1: ((0, 2),)
>>>


That's it!

No comments: