I finished some working version of the pari-python module. I tried to make it is close as possible to the standard PARI shell, at the same time using the standard python syntax. Here I put some screenshots. I didn’t make a proper package distribution for python (the code still looks ugly and I still don’t know how to make proper distributions), but if someone is interested to test it send me an email. This is in early alpha stage. A lot of things are not working. I imported almost all functions of gp by an automated perl script but I don’t know which of them actually work and which not.
There are two special difficulties you may notice about python. The first one is the power operation. In python it is ‘**’, whereas ‘^’ is reserved for the bitwise xor. I made some little changes to the python source so that ‘^’ and ‘^=’ now work as power, and ‘^^’ and ‘^^=’ work as xor if you still want to use it. This is done by modifying about 30 lines of source code in several files: Include/token.h, Modules/parsermodule.c, Parser/tokenizer.c, Python/ast.c, Grammar/Grammar.
The second difficulty is that expressions like ’1/2′ produce 0 in python. For this my module installes my own handler for the operation ‘divide’ for integers and longs. That’s it. In other respects it is a normal python module.
This is an example of using the ‘help(pari)’ command: