I waste a lot of time between Vim and Python. I find it too slow to manually copy-paste from Python to Vim and vice versa. A good broken example is:
%
I think you't just missing the -c
flag. For example:
:.!python -c "print 'hello'"
You should not that the script that you provide acts as a filter on the line selection. That is, your script can read from stdin
to operate directly on the lines given (.
, %
, ...). Anything more than the simplest tasks, however, and you'd be better off putting the python commands into a script file of its own.