data can be written to file with print statements file objects have also write(function the write(does not automatically add newline output py outfile open('out'' 'print >outfile"headerprint >outfile"{ : { : }format(xyoutfile open('out'' 'outfile write("header\ "outfile write("{ : { : }format(xy)file should be closed after writing is finished