The reason it's not working is that you have conflicting redirections. echo | python tries to tie standard input to the pipe from echo, while python - <<HERE tries to tie standard input to the here document. You can't have both. (The here document wins.)
However, there is really no reason to want to pipe the script itself on standard input.
bash$ echo hello | python -c '
> import sys
> for line in sys.stdin:
> print line'
hello
Another solution might be to embed your data in a triple-quoted string within the script itself.
python <<\____
import sys
data = """
hello
so long
"""
for line in data.strip('\n').split('\n'):
print line
____
The newlines between the triple quotes are all literal, but the .strip('\n') removes any from the beginning or the end. (You can't do that if you have significant newlines at the end, of course.)
The backslash before the here-document separator says to not perform any variable interpolation or command substitutions inside the here document. If you want to use those features, take it out (but then of course take care to individually escape any literal dollar signs or backticks in your Python code).