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

About this user

Korakot Chaovavanich http://korakot.stumbleupon.com

« Newer Snippets
Older Snippets »
Showing 1-1 of 1 total  RSS 

Print to a file

To print to console, it's easy
   1  print 'hello', 'world'

To print to an output file, it's similar
   1  f = open('out.txt','w')
   2  print >>f, 'hello', 'world'
« Newer Snippets
Older Snippets »
Showing 1-1 of 1 total  RSS