[IronPython] Python Cryptographic Toolkit for IronPython

Jörgen Stenarson jorgen.stenarson at bostream.nu
Wed Nov 15 21:05:46 CET 2006


Hi

I'm happy to announce that my attempt to port pyreadline to ironpython 
finally has reached a state where I think it can be used. A new feature 
of this version of pyreadline is that you can select text using 
shift-Left/Right. Copy is bound to ctrl-shift-x (I might move it to 
ctrl-c but right now ctrl-c generates KeyboardInterupt so that will 
probably take some work)

It has not been too difficult to get it to work. Most work was spent 
trying to understand and work around the differences between plain win32 
console functions and .NET System.Console.

In this post I will describe how you can try it out for your self, in 
another post I will describe the differences I found between how cpython 
and ironpython use readline.


1) You will need to compile your own version of ironpython because there 
is need for a patch to allow pyreadline to insert itself as a new readline.

    Download ironpython source and make sure you can compile it.

    then in the file PythonCommandLine.cs patch the class definition:

     change:

     class PythonCommandLine

     to:

     public class PythonCommandLine
Now recompile

2) you will also need to patch rlcompleter.py in the cpython lib if you 
want tab completion to work for global variables

    line 85:
                self.namespace = __main__.__dict__
    should read
                self.namespace = __main__.__dict__.copy()

3) get pyreadline using svn from:
svn co http://ipython.scipy.org/svn/ipython/pyreadline/branches/refactor 
  localpath/pyreadline_branch



4) copy pyreadlineconfig.ini from 
localpath/pyreadline_branch/pyreadline/configuration/ to your 
c:/documents and settings/USERNAME

   copy startup.py from 
localpath/pyreadline_branch/pyreadline/configuration/ to your pythonpath



5) launch ipy and do import startup. Now you should have pyreadline 
active with tabcompletion


/Jörgen






More information about the Ironpython-users mailing list