File read from stdin and printed to temp file are not identicial?

2010-09-16 Thread Jean Luc Truchtersheim
Hello, I am trying to read from stdin and dump what's read to a temporary file. My code works for small files but as soon as I have a file that has, e.g., more than 300 lines, there is always one and only one line that is truncated compared to the input. Here is my code:

Re: File read from stdin and printed to temp file are not identicial?

2010-09-16 Thread Jason Swails
On Thu, Sep 16, 2010 at 7:36 PM, Jean Luc Truchtersheim jeanluc...@gmail.com wrote: Hello, I am trying to read from stdin and dump what's read to a temporary file. My code works for small files but as soon as I have a file that has, e.g., more than 300 lines, there is always one and only

Re: File read from stdin and printed to temp file are not identicial?

2010-09-16 Thread MRAB
On 17/09/2010 00:36, Jean Luc Truchtersheim wrote: Hello, I am trying to read from stdin and dump what's read to a temporary file. My code works for small files but as soon as I have a file that has, e.g., more than 300 lines, there is always one and only one line that is truncated compared to

Re: File read from stdin and printed to temp file are not identicial?

2010-09-16 Thread James Mills
On Fri, Sep 17, 2010 at 9:36 AM, Jean Luc Truchtersheim jeanluc...@gmail.com wrote: Can anybody reproduce this behavior. Jean it would help if you could provide samples of your input and output files. I'm pretty sure I might have a clue as to what your problem might be, but I can't be sure until

Re: File read from stdin and printed to temp file are not identicial?

2010-09-16 Thread James Mills
On Fri, Sep 17, 2010 at 10:06 AM, MRAB pyt...@mrabarnett.plus.com wrote: You're not closing f_in. That line should be: Although this _could_ be the problem (buffers not being flushed and the file being properly closed, etc) it could be something else... --James -- -- James Mills -- --

Re: File read from stdin and printed to temp file are not identicial?

2010-09-16 Thread Jean Luc Truchtersheim
Dear Fellow python users, Many thanks for your help. Those missing brackets were the cause of my problem. Now my program works as expected. Many, many heartfelt thanks. -- http://mail.python.org/mailman/listinfo/python-list

Re: File read from stdin and printed to temp file are not identicial?

2010-09-16 Thread James Mills
On Fri, Sep 17, 2010 at 10:25 AM, Jean Luc Truchtersheim jeanluc...@gmail.com wrote: Dear Fellow python users, Many thanks for your help. Those missing brackets were the cause of my problem. Now my program works as expected. Many, many heartfelt thanks. Glad to hear it! Do you understand