Re: Python thinks file is empty

2007-11-05 Thread Tim Roberts
loial <[EMAIL PROTECTED]> wrote: > >I am writing a file in python with writelines > >f = open('/home/john/myfile',"w") >f.writelines("line1\n") >f.writelines("line2\n") >f.close() Are you absolutely sure it looks like that? If you wrote this: f.close (as reformed VB programmers tend to write

Re: Python thinks file is empty

2007-11-05 Thread Gabriel Genellina
En Mon, 05 Nov 2007 12:57:15 -0300, Tim Chase <[EMAIL PROTECTED]> escribió: > To confuse matters, it happens to work in your example, because a > string is an iterable that returns each character in that string > as the result, so code like this > >f.writelines('hello\n') > > is effectively

Re: Python thinks file is empty

2007-11-05 Thread Tim Chase
loial wrote: > I am writing a file in python with writelines > > f = open('/home/john/myfile',"w") > f.writelines("line1\n") > f.writelines("line2\n") > f.close() > > But whenever I try to do anything with the file in python it finds no > data. I am trying ftp, copying the file...the resultant f

Re: Python thinks file is empty

2007-11-05 Thread kyosohma
On Nov 5, 9:19 am, loial <[EMAIL PROTECTED]> wrote: > I am writing a file in python with writelines > > f = open('/home/john/myfile',"w") > f.writelines("line1\n") > f.writelines("line2\n") > f.close() > > But whenever I try to do anything with the file in python it finds no > data. I am trying ft