Tuesday, June 26, 2007

Emacs with Python

Emacs with Python

Emacs has good Python support, however it may or may have not been installed by default on your copy. I leave that as an exercise for the reader.

When you are editing a file with extension .py, then Emacs goes into python mode. Perhaps the interesting key commands are:

C-c C-c

Executes the current buffer.

C-c !

Brings up the Python Shell.

C-c C-w

Runs pychecker on the current buffer.

C-c ?

Brings up the help file for Python Mode (As normal, use C-M-v to scroll the help window).

There are loads of other commands that the help file will explain, such as how to move through the buffer according to the Python elements or how to execute parts of the file, but I will try to remember these four to start with!

Guide to Key-bindings

If you did not understand the above then you need to know that, following normal Emacs conventions, Control is represented by the large C, the small c is the 'c key', i.e. the third letter of the alphabet. M means Meta, which is a key on 1970s Unix keyboards, called Alt on the mass-produced IBM-compatible keyboards that we have today (as an alternative, you can use escape and then take a little breath before pressing the next key).

0 Comments:

Post a Comment

<< Home