Is there a way to turn on python syntax highlighting for Terminal.app on Mac OS X?

link|improve this question
Do you mean inside the Python read-eval-print interpreter? – Lawrence Velázquez Mar 31 '10 at 5:38
feedback

3 Answers

If you just want to highlight sources you dump into the terminal a la cat try excellent pygments. It actually supports a lot of languages. Run with

pygmentize source.py

If instead you were talking about editing files with syntax highlighting inside a mac terminal, this really depends on the editor.

  • for vi or vim you want at least these option in ~/.vimrc

    syntax on
    
  • emacs works right out of the box

  • don't ask me about nano.
link|improve this answer
nanos teh shit man. the only of those i can actually use ;) – Mark Mar 31 '10 at 3:38
include "/usr/share/nano/python.nanorc" - quite good. – grawity Mar 31 '10 at 18:18
feedback

Try ipython. It highlights syntax and much more.
I haven't tried it on Mac but looks like it must work:
http://stackoverflow.com/questions/726449/installing-ipython-with-readline-on-the-mac

Another option is WxPython and pycrust (which works without Terminal.app :( )

link|improve this answer
feedback

Your Answer

 
or
required, but never shown