I am trying to simply write a list of values to txt file in one column. I would then like to add another list in a second column. Somehow they only appear as one long row. Any feedback will be greatly appreciated.
print "rain max values", rmax print "yearmonth", monthyear OutputFolder=r"E:/test_out/" myfile=open(OutputFolder+'test.txt','w') myfile.write(str(monthyear)) myfile.write(str(rmax)) myfile.close() In python: rain max values [43.8748, 35.838270000000001, 18.659849999999999, 60.201709999999999, 21.69989, 25.27929, 16.081009999999999, 14.198729999999999, 33.5246, 19.710170000000002, 22.904209999999999, 17.301929999999999, 39.372410000000002, 39.290640000000003, 25.442820000000001, 33.322339999999997, 28.252970000000001, 40.388719999999999, 8.7627600000000001, 54.516460000000002, 109.756, 15.863519999999999, 31.598600000000001] yearmonth ['20110906', '20110907', '20110908', '20110909', '20110910', '20110911', '20110912', '20110913', '20110914', '20110915', '20110916', '20110917', '20110918', '20110919', '20110920', '20110921', '20110922', '20110923', '20110924', '20110925', '20110926', '20110927', '20110928'] in my text file: ['20110906', '20110907', '20110908', '20110909', '20110910', '20110911', '20110912', '20110913', '20110914', '20110915', '20110916', '20110917', '20110918', '20110919', '20110920', '20110921', '20110922', '20110923', '20110924', '20110925', '20110926', '20110927', '20110928'][43.8748, 35.838270000000001, 18.659849999999999, 60.201709999999999, 21.69989, 25.27929, 16.081009999999999, 14.198729999999999, 33.5246, 19.710170000000002, 22.904209999999999, 17.301929999999999, 39.372410000000002, 39.290640000000003, 25.442820000000001, 33.322339999999997, 28.252970000000001, 40.388719999999999, 8.7627600000000001, 54.516460000000002, 109.756, 15.863519999999999, 31.598600000000001]
_______________________________________________ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor