On May 21, 11:15 am, Paul McGuire <[EMAIL PROTECTED]> wrote:
>
>
> for cur_rec in Lastdump.readline():
>
> is the problem. readline() returns a string containing the next
> line's worth of text, NOT an iterator over all the subsequent lines in
> the file. So your code is really saying:
>
>
On May 21, 10:59 am, Damon Getsman <[EMAIL PROTECTED]> wrote:
> I'm having an issue parsing lines of 'last' output that I have stored
> in a /tmp file. The first time it does a .readline() I get the full
> line of output, which I'm then able to split() and work with the
> individual fields of with
Okay, so I manged to kludge around the issue by not using
the .readline() in my 'for' statement. Instead, I'm slurping the
whole file into a new list that I put in for that purpose, and
everything seems to be working just fine. However, I don't know WHY
the other method failed and I'm at a loss f
Okay so I'm writing a script in python right now as a dirty fix for a
problem we're having at work.. Unfortunately this is the first really
non-trivial script that I've had to work with in python and the book
that I have on it really kind of sucks.
I'm having an issue parsing lines of 'last' outp