Re: print or write on a text file ?

2012-10-01 Thread nn
On Sep 28, 2:42 pm, Franck Ditter wrote: > Hi ! > Here is Python 3.3 > Is it better in any way to use print(x,x,x,file='out') > or out.write(x) ? Any reason to prefer any of them ? > There should be a printlines, like readlines ? > Thanks, > >     franck There is out.writelines(lst) -- http://m

Re: print or write on a text file ?

2012-09-28 Thread Terry Reedy
On 9/28/2012 2:42 PM, Franck Ditter wrote: Hi ! Here is Python 3.3 Is it better in any way to use print(x,x,x,file='out') or out.write(x) ? Any reason to prefer any of them ? print converts objects to strings and adds separators and terminators. If you have a string s and want to output it as

Re: print or write on a text file ?

2012-09-28 Thread Wayne Werner
On Fri, 28 Sep 2012, Franck Ditter wrote: Hi ! Here is Python 3.3 Is it better in any way to use print(x,x,x,file='out') or out.write(x) ? Any reason to prefer any of them ? There should be a printlines, like readlines ? Thanks, The print function automatically appends newlines to the end of w

print or write on a text file ?

2012-09-28 Thread Franck Ditter
Hi ! Here is Python 3.3 Is it better in any way to use print(x,x,x,file='out') or out.write(x) ? Any reason to prefer any of them ? There should be a printlines, like readlines ? Thanks, franck -- http://mail.python.org/mailman/listinfo/python-list