13 August 2006

Print piping in python

print > open("file","w"), "File content" print >> sys.stdout, "Hello world" What a nice feature of pythons. Had thought this might be possible for a while, but never got the actual syntax. Having programmed php for a time, it is good to be back to python, where you haven't even got to put "\n" in the end of the prints :)

No comments: