Problem with lists

David C. Fox davidcfox at post.harvard.edu
Mon Aug 25 16:31:29 EDT 2003


WIWA wrote:

> Hi,
> 
> I'm writing an application to analyse my Apache access_log file. In
> the below script (which is based on an example I found in 'How to
> think as a Programmer'-) I want to measure the amount of hits per
> hour. I know it is not the best algorithm but it works for now.
> 
> I see some strange things: on rather small (it must be +/- < 4000 )
> entries in the access_log, my script works fine. Above this limit, I
> get the following error.
> 
> Traceback (most recent call last):
>   File "hits_per_uur.py", line 18, in
>     lijst.append(int(datum[1]))
> IndexError: list index out of range
> 

The error could be in datum[1].  Did you double-check that datum has at 
least two elements?

David





More information about the Python-list mailing list