Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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

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

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


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.
share|improve this answer
include "/usr/share/nano/python.nanorc" - quite good. – grawity Mar 31 '10 at 18:18

Try ipython. It highlights syntax and much more.
I haven't tried it on Mac but looks like it must work:

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

share|improve this answer

Here is a series of screencasts, that shows bpython in action:

share|improve this answer
While this link may answer the question, it is better to include the essential parts of the answer here and provide the link for reference. Link-only answers can become invalid if the linked page changes. – Diogo Aug 9 '12 at 12:45
@Diogo, visiting the site will show that this link is to how-to videos. It's difficult to include essential parts in that respect. I agree that the answer needs work, but I don't think your comment is helpful. – user3463 Aug 12 '12 at 5:41
No problem Randolph, this comment was automatically posted by the review system when I reviewed it. – Diogo Aug 12 '12 at 14:19

You must log in to answer this question.