Sunday, April 17, 2011

Python development on Kubuntu or Ubuntu with emacs !

Here is what you have to do
1. Get the python mode files from https://launchpad.net/python-mode , it is a gz file with 4 files and 1 readme in it.
2. unzip that and put the files in your home folder (~/)
3. Now create a file .emacs in your home folder (if you have it already its fine). Add this to the file
----
(load "~/python-mode.el")
;;python
(setq auto-mode-alist (cons '("\\.py$" . python-mode) auto-mode-alist))
(setq interpreter-mode-alist (cons '("python" . python-mode)
interpreter-mode-alist))
(autoload 'python-mode "python-mode" "Python editing mode." t)

(global-font-lock-mode t)
(font-lock-mode +1)
----
4. Now restart emacs.
5. Write python code and then C-c C-c for executing it .. C-c ! for the shell ..

Have fun !

No comments: