Starting from the basic facts:

  • you can’t always code in pair
  • you don’t want to compile & tests to check that is fine in the last few line you have just written
  • you want to write nice python code
  • you want to improve the way you write python

It exists a few very interesting softwares that can help you.

Here is a list of the one I am using really often:

PyFlakes –

PyLint –

These two are nice also but not as good as the previous one:

PyMetrics –

PyChecker –

These tool are directly linked to my favourite editor VI:

command Pyflakes :call Pyflakes()
function! Pyflakes()
    let tmpfile = tempname()
    execute "w" tmpfile
    execute "set makeprg=(pyflakes\\ " . tmpfile . "\\\\\\|sed\\ s@" . tmpfile ."@%@)"
command Pylint :call Pylint()
function! Pylint()
    setlocal makeprg=(echo\ '[%]';\ pylint\ %)
    setlocal efm=%+P[%f],%t:\ %#%l:%m
    silent make

And better each time you save your python file in vim , I check for wrong imports with Pyflakes with:

autocmd BufWrite *.{py} :call Pyflakes()