When I print to output of a script in VIM I can't scroll up, so I can see only the last lines. For example if this is my script:
for i in range(1000):
    print str(i)+"TEST"
And I run this command:
:w !python -
How can I scroll to see the e.g. 500TEST lines. I've see this question but this doesn't work for mac OSX.
                        
I don't think MacVim/GVim's pseudo terminal is able of scrolling with the usual scrolling keys. Did you try piping your command into a pager? The following works, here:
(edit)
lesshas a lot of vi-like commands. Use/footo search forward,?footo search backward,50Gto jump to line 50,<C-f>to page down,$ less +Gto jump directly to last line`…$ man lessis a surprisingly good read.