Contents |
:py print "hello"
:r!python -c "import math;print math.pi"
:py<< for n in range(11): print n*n .
Try this little thing:
from vim import *
from math import *
command('exe "normal gg/#[-\ ]*end\ of\ code\<Cr>jdG"') # delete everything below 'end of code'
aa = " .:+*xX08"
for y in range(32):
current.buffer.append("#"+" "*int(sin(y/3.)*36+40)+"*")
# --- end of code ---
Paste it into Vim, save it and execute the command :pyf <filename of program>
If you want more of this stuff, see Python ASCII Art for some pretty crazy examples...