Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Python highlighting in emacs

I am using emacs 23 -nw and xterm installed on Debian Squeeze. I need highlighting with python but I don't have it. How can I enable it?

Edit: Thanks for all answers, the problem is that

  • I have googled a lot, really.
  • I have the code on a file with extension .py
  • The script starts with #!/usr/bin/python, as one of the the answers points I have changed to !#/usr/bin/env python
  • I used M-x and tried to find something related to python, well there many options which do not solve my problem.

Sorry my question was not very precise and I even accept -10 but I don't have highlight which would give me red highlight for lines starting # etc. To be more precise I have a very a dull highlight; lines with # are white, lines between """ """ are green, some of the variable names are yellow but don't know why not all. [import, as, from] are light blue, [open, max, and other function names] are dark blue etc. And besides my 200 lines of code is working.

like image 869
heimatlos Avatar asked Dec 04 '25 11:12

heimatlos


1 Answers

I'm not sure if this is right, but try the following.

1) M-x

2) type in "python-mode". Tab completion works here so type in "pyth" and hit tab and you can see what your options are.

mj

like image 118
mj_ Avatar answered Dec 07 '25 00:12

mj_