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:

%!python for i in xrange(25); print 6*i \n     

How can you do such tweaks direcly in Vim?   [Solved]
[Clarification]  I need things to Vim, like printing sequences, arithmetics... - things I cannot do in Vim.
[?] Can someone elaborate this point:
"your script can read from stdin to operate directly on the lines given (., %, ...)." 
[Further Clarification]
If I want to print 'Hello' to lines 4,5, 6 and 7, what is wrong:

:4-7!python -c "print 'hello'"

The dot . modifies the current line. Can I print on multiple lines 7, 32 and 99:

:7,32,99!python -c "print 'hello'"

Clearly not working. How?
If I want to print 'Hello' to lines 4,5, 6 and 7, what is wrong:

If you want to do something in randomly chosen places throughout your file, you're better of recording keystrokes and replaying them. Go to the first line you want to change, and hit qz to starting recording into register z. Do whatever edits you want for that line and hit q again when you're finished. Go to the next line you want to change and press @z to replay the macro.
How can you use Python in Vim?