Found this useful Python snippet in Python Essential Reference by David M.Beazley today. It seems you can write to files in a similar way to how you would with IOStream in C++ by using the ‘>>’ syntax.
f = open('out.txt', 'w')
print >>f, 'Hello, World'
Unfortunately this only works in Python 2.x, and will break in Python 3 — so perhaps it is best left alone. Nonetheless, it’s a feature I didn’t realize before today!