When I write python script in VIM I would like to test them into VIM directly I know that I can use:
w !python -
But this execute the script and suddenly close the shell so if I want to test a function I can't call it with various arguments! For example if I have this code:
print "How can I test the following function in Vim?"
def testfunc(test):
print test*2
When I run in VIM w !python - it print me the print statement but I can't try to test the function with some arbitrary arguments. How can I run the script in a python shell for further testing?