On 12-Apr-2012, at 8:01 AM, questions anon wrote:

> 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", month year

'print' adds newline automatically.
More info:
http://docs.python.org/reference/simple_stmts.html#print

> OutputFolder=r"E:/test_out/"
> myfile=open(OutputFolder+'test.txt','w')
> myfile.write(str(monthyear))
> myfile.write(str(rmax))
> myfile.close()

'write' does not add newline. You need to add '\n' where you want new line.


-- 
shantanoo
_______________________________________________
Tutor maillist  -  [email protected]
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor

Reply via email to