Re: [Tutor] Reading large bz2 Files

2010-02-22 Thread Stefan Behnel
Norman Rieß, 19.02.2010 13:42: > i am trying to read a large bz2 file with this code: > > source_file = bz2.BZ2File(file, "r") > for line in source_file: > print line.strip() > > But after 4311 lines, it stoppes without a errormessage. The bz2 file is > much bigger though. Could you send in

Re: [Tutor] Reading large bz2 Files

2010-02-19 Thread Norman Rieß
Am 19.02.2010 22:24, schrieb Lie Ryan: > On 02/20/10 07:49, Norman Rieß wrote: > >> Am 19.02.2010 21:42, schrieb Lie Ryan: >> >>> On 02/19/10 23:42, Norman Rieß wrote: >>> >>> Hello, i am trying to read a large bz2 file with this code: source_file = bz2.BZ

Re: [Tutor] Reading large bz2 Files

2010-02-19 Thread Norman Rieß
Am 19.02.2010 22:03, schrieb Kent Johnson: > On Fri, Feb 19, 2010 at 7:42 AM, Norman Rieß wrote: > >> Hello, >> >> i am trying to read a large bz2 file with this code: >> >> source_file = bz2.BZ2File(file, "r") >> for line in source_file: >>print line.strip() >> >> But after 4311 lines, it

Re: [Tutor] Reading large bz2 Files

2010-02-19 Thread Lie Ryan
On 02/20/10 07:49, Norman Rieß wrote: > Am 19.02.2010 21:42, schrieb Lie Ryan: >> On 02/19/10 23:42, Norman Rieß wrote: >> >>> Hello, >>> >>> i am trying to read a large bz2 file with this code: >>> >>> source_file = bz2.BZ2File(file, "r") >>> for line in source_file: >>> print line.strip()

Re: [Tutor] Reading large bz2 Files

2010-02-19 Thread Lie Ryan
On 02/20/10 07:42, Lie Ryan wrote: > On 02/19/10 23:42, Norman Rieß wrote: >> Hello, >> >> i am trying to read a large bz2 file with this code: >> >> source_file = bz2.BZ2File(file, "r") >> for line in source_file: >> print line.strip() >> >> But after 4311 lines, it stoppes without a errormess

Re: [Tutor] Reading large bz2 Files

2010-02-19 Thread Kent Johnson
On Fri, Feb 19, 2010 at 7:42 AM, Norman Rieß wrote: > Hello, > > i am trying to read a large bz2 file with this code: > > source_file = bz2.BZ2File(file, "r") > for line in source_file: >    print line.strip() > > But after 4311 lines, it stoppes without a errormessage. The bz2 file is > much bigg

Re: [Tutor] Reading large bz2 Files

2010-02-19 Thread Norman Rieß
Am 19.02.2010 21:42, schrieb Lie Ryan: > On 02/19/10 23:42, Norman Rieß wrote: > >> Hello, >> >> i am trying to read a large bz2 file with this code: >> >> source_file = bz2.BZ2File(file, "r") >> for line in source_file: >> print line.strip() >> >> But after 4311 lines, it stoppes without a

Re: [Tutor] Reading large bz2 Files

2010-02-19 Thread Lie Ryan
On 02/19/10 23:42, Norman Rieß wrote: > Hello, > > i am trying to read a large bz2 file with this code: > > source_file = bz2.BZ2File(file, "r") > for line in source_file: > print line.strip() > > But after 4311 lines, it stoppes without a errormessage. The bz2 file is > much bigger though.

Re: [Tutor] Reading large bz2 Files

2010-02-19 Thread Norman Rieß
Am 19.02.2010 17:04, schrieb Steven D'Aprano: > My guess is one of two things: > (1) You are mistaken that the file is bigger than 4311 lines. > > (2) You are using Windows, and somehow there is a Ctrl-Z (0x26) > character in the file, which Windows interprets as End Of File when > reading files

Re: [Tutor] Reading large bz2 Files

2010-02-19 Thread Stefan Behnel
Norman Rieß, 19.02.2010 13:42: > i am trying to read a large bz2 file with this code: > > source_file = bz2.BZ2File(file, "r") > for line in source_file: > print line.strip() > > But after 4311 lines, it stoppes without a errormessage. What does "stops" mean here? Does it crash? Does it exit

Re: [Tutor] Reading large bz2 Files

2010-02-19 Thread Steven D'Aprano
On Fri, 19 Feb 2010 11:42:07 pm Norman Rieß wrote: > Hello, > > i am trying to read a large bz2 file with this code: > > source_file = bz2.BZ2File(file, "r") > for line in source_file: > print line.strip() > > But after 4311 lines, it stoppes without a errormessage. The bz2 file > is much bigg

[Tutor] Reading large bz2 Files

2010-02-19 Thread Norman Rieß
Hello, i am trying to read a large bz2 file with this code: source_file = bz2.BZ2File(file, "r") for line in source_file: print line.strip() But after 4311 lines, it stoppes without a errormessage. The bz2 file is much bigger though. How can i read the whole file line by line? Thank you.