py: Make print() accept "file" argument, and actually print to stream.

And not printf(), like it was before.