Cannot find what I'm sure is a simple command... please help.

A. Jones netzapper at magicstar.net
Sun Mar 31 20:24:44 EST 2002


On Sun, 31 Mar 2002 19:39:45 -0500, "John Roth"
<johnroth at ameritech.net> wrote:

>
>"Aahz" <aahz at pythoncraft.com> wrote in message
>news:a886fp$sq1$1 at panix1.panix.com...
>> In article <3ca7978b.251291804 at mammoth.usenet-access.com>,
>> A. Jones <netzapper at magicstar.net> wrote:
>> >
>> >I seem to have either overlooked, or completely missed a function
>that
>> >allows one to open a specific line of a file.
>>
>> There isn't one, unless every line of your file is the same length
>> (fixed-length records).  You need to read one line at a time until you
>> get to the correct line.
>
>If you read the file into a list using readlines(), you can then
>access each line by the index into the list. Unfortunately, that
>doesn't get you one line without reading the entire file up to
>that point...
>
>John Roth

Right, I knew I could do that.  However, when I did that, it causes a
meltdown when I index from that list, owing to the large size of the
file (it's a database, with each entry on a separate line, but with an
arbitrary line size).


-----------== Posted via Newsfeeds.Com, Uncensored Usenet News ==----------
   http://www.newsfeeds.com       The Largest Usenet Servers in the World!
------== Over 100,000 Newsgroups - Ulimited downloads - 19 servers ==-----



More information about the Python-list mailing list