Re: write to file

2018-05-06 Thread Sharan Basappa
On Sunday, 6 May 2018 10:48:12 UTC+5:30, Chris Angelico wrote: > On Sun, May 6, 2018 at 3:10 PM, Sharan Basappa > wrote: > > On Saturday, 5 May 2018 21:47:33 UTC+5:30, Steven D'Aprano wrote: > >> On Sat, 05 May 2018 08:45:39 -0700, Sharan Basappa wrote: > >> > >> > Thanks a lot. I have actually

Re: write to file

2018-05-05 Thread Chris Angelico
On Sun, May 6, 2018 at 3:10 PM, Sharan Basappa wrote: > On Saturday, 5 May 2018 21:47:33 UTC+5:30, Steven D'Aprano wrote: >> On Sat, 05 May 2018 08:45:39 -0700, Sharan Basappa wrote: >> >> > Thanks a lot. I have actually tried print with file handle as a >> > parameter (the last option). I see th

Re: write to file

2018-05-05 Thread Sharan Basappa
On Saturday, 5 May 2018 21:47:33 UTC+5:30, Steven D'Aprano wrote: > On Sat, 05 May 2018 08:45:39 -0700, Sharan Basappa wrote: > > > Thanks a lot. I have actually tried print with file handle as a > > parameter (the last option). I see that the file is created but nothing > > is logged. > > That

Re: write to file

2018-05-05 Thread Sharan Basappa
On Saturday, 5 May 2018 22:05:53 UTC+5:30, Mark Lawrence wrote: > On 05/05/18 12:25, Sharan Basappa wrote: > > In my program, I have print statements for debugging. > > However, these are cluttering the display. So, I am trying to save > > these to a file but somehow I cant seem to get it correct.

Re: write to file

2018-05-05 Thread Mark Lawrence
On 05/05/18 12:25, Sharan Basappa wrote: In my program, I have print statements for debugging. However, these are cluttering the display. So, I am trying to save these to a file but somehow I cant seem to get it correct. Use the logging module https://docs.python.org/3/library/logging.html for

Re: write to file

2018-05-05 Thread Steven D'Aprano
On Sat, 05 May 2018 08:45:39 -0700, Sharan Basappa wrote: > Thanks a lot. I have actually tried print with file handle as a > parameter (the last option). I see that the file is created but nothing > is logged. That could be a file buffer issue. Nothing will actually be written to the disk until

Re: write to file

2018-05-05 Thread Sharan Basappa
On Saturday, 5 May 2018 19:00:12 UTC+5:30, Steven D'Aprano wrote: > On Sat, 05 May 2018 04:25:50 -0700, Sharan Basappa wrote: > > > In my program, I have print statements for debugging. However, these are > > cluttering the display. So, I am trying to save these to a file but > > somehow I cant s

Re: write to file

2018-05-05 Thread Steven D'Aprano
On Sat, 05 May 2018 04:25:50 -0700, Sharan Basappa wrote: > In my program, I have print statements for debugging. However, these are > cluttering the display. So, I am trying to save these to a file but > somehow I cant seem to get it correct. There are lots of way to solve this problem. The bes

Re: Write to file and see content on screen

2008-06-10 Thread MRAB
On Jun 10, 2:01 am, [EMAIL PROTECTED] wrote: > Hello all, > > New user to python. I can write to a file, however, I would like to > do both...whatever I do on the screen, I'd like to write it to a file. > > any pointers on where I can find this info. > > thanks, Something like this, perhaps? cl

Re: Write to file and see content on screen

2008-06-09 Thread Timothy Grant
On Mon, Jun 9, 2008 at 6:01 PM, <[EMAIL PROTECTED]> wrote: > Hello all, > > New user to python. I can write to a file, however, I would like to > do both...whatever I do on the screen, I'd like to write it to a file. > > any pointers on where I can find this info. > > thanks, > This code has on

Re: Write to file and see content on screen

2008-06-09 Thread CM
On Jun 9, 9:01 pm, [EMAIL PROTECTED] wrote: > Hello all, > > New user to python. I can write to a file, however, I would like to > do both...whatever I do on the screen, I'd like to write it to a file. > > any pointers on where I can find this info. > > thanks, There is probably some smart way t