[Tutor] text editor and debugger for python
bhaaluu at gmail.com
Tue Mar 24 17:41:23 CET 2009
On Tue, Mar 24, 2009 at 5:08 AM, Bala subramanian
<bala.biophysics at gmail.com> wrote:
> I do the scripting in Linux. I use vi editor to code. It is not very
> convenient for me. Kindly suggest me a best free text editor ( i can code
> and debug the code simultaneously ) for python based on your experience.
I use the vim text editor to program in Python. Vim is very similar to vi.
I use the following to make vim easier for programming (save as .vimrc)
" Created by Jeff Elkner 23 January 2006
" Last modified 2 February 2006
" Turn on syntax highlighting and autoindenting
filetype indent on
" set autoindent width to 4 spaces (see
" set line number (added by bhaaluu)
" Bind <f2> key to running the python interpreter on the currently active
" file. (courtesy of Steve Howell from email dated 1 Feb 2006).
map <f2> :w\|!python %<cr>
After saving the above file as .vimrc (dot vimrc) in your home directory
(/home/bala/.vimrc <- for example) you can fire up vim and start
programming in Python.
Press the F2 function key to run your Python code.
When the code completes its run, you are returned to vim for more coding.
For debugging, I use print and raw_input().
I use print to watch variables. I use raw_input() to set breakpoints.
b h a a l u u at g m a i l dot c o m
Kid on Bus: What are you gonna do today, Napoleon?
Napoleon Dynamite: Whatever I feel like I wanna do. Gosh!
More information about the Tutor