[Numpy-discussion] Syntax highlighting for Cython and NumPy

Sturla Molden sturla@molden...
Tue Oct 27 16:46:08 CDT 2009


Here is an XML for Cython syntax highlighting in katepart (e.g. KATE and 
KDevelop). I made this because KATE is my faviourite text edior (feel 
free to call me a heretic for not using emacs). Unfortunately, the 
Python highlighting for KDE contains several bugs. And the Pyrex/Cython 
version that circulates on the web builds on this and introduces a 
couple more. I have tried to clean it up. Note that this will also 
highlight numpy.* or np.*, if * is a type or function you get from 
"cimport numpy" or "import numpy". This works on Windows as well, if you 
have installed KDE for Windows. Just copy the XML to:

   ~/.kde/share/apps/katepart/syntax/
   C:\kde\share\apps\katepart\syntax  (or whereever you have KDE installed)

and "Cython with NumPy" shows up under Sources. Anyway, this is the 
syntax high-lighter I use to write Cython. Feel free to use it as you wish.

P.S. I am also cleaning up Python high-lighting for KDE. Not done yet, 
but I will post a "Python with NumPy" highlighter later on if this is 
interesting.

P.P.S. This also covers Pyrex, but add in some Cython stuff.


Sturla Molden
-------------- next part --------------
A non-text attachment was scrubbed...
Name: cython.xml
Type: text/xml
Size: 34481 bytes
Desc: not available
Url : http://mail.scipy.org/pipermail/numpy-discussion/attachments/20091027/fe8112cf/attachment-0001.xml 


More information about the NumPy-Discussion mailing list