Never been to DZone Snippets before?

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 (See related posts)

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'

You need to create an account or log in to post comments to this site.


Click here to browse all 4858 code snippets

Related Posts