DZone Snippets is a public source code repository. Easily build up your personal collection of code snippets, categorize them with tags / keywords, and share them with the world
Print To A File
To print to console, it's easy
print 'hello', 'world'
To print to an output file, it's similar
f = open('out.txt','w') print >>f, 'hello', 'world'