Bruno Ferreira wrote:
I wrote a very simple python program to generate a sorted list of
lines from a squid access log file.
Now that your immediate problem is solved it's time to look at the heapq
module. It solves the problem of finding the N largest items in a list
much more efficiently. I
Hello all,
Amazing :)
The program is working properly now, the code is much better and I
learned a bit more Python.
Thank you all, guys.
Bruno.
2008/1/4, Peter Otten [EMAIL PROTECTED]:
Bruno Ferreira wrote:
I wrote a very simple python program to generate a sorted list of
lines from a
Hi,
I wrote a very simple python program to generate a sorted list of
lines from a squid access log file.
Here is a simplified version:
##
1 logfile = open (squid_access.log, r)
2 topsquid = [[0, 0, 0, 0, 0, 0, 0]]
3
4 def add_sorted (list):
5 for i in
Bruno Ferreira wrote:
Hi,
I wrote a very simple python program to generate a sorted list of
lines from a squid access log file.
Here is a simplified version:
##
1 logfile = open (squid_access.log, r)
2 topsquid = [[0, 0, 0, 0, 0, 0, 0]]
3
4 def
Bruno Ferreira wrote:
Hi,
I wrote a very simple python program to generate a sorted list of
lines from a squid access log file.
Here is a simplified version:
##
1 logfile = open (squid_access.log, r)
2 topsquid = [[0, 0, 0, 0, 0, 0, 0]]
3
4 def
Bruno Ferreira wrote:
Hi,
I wrote a very simple python program to generate a sorted list of
lines from a squid access log file.
Here is a simplified version:
##
1 logfile = open (squid_access.log, r)
2 topsquid = [[0, 0, 0, 0, 0, 0, 0]]
3
4 def
Bruno Ferreira wrote:
When I execute the program _without_ the lines 10 and 11:
10 if len(topsquid) 50:
11 topsquid = topsquid[0:50]
it runs perfectly.
But if I execute the program _with_ those lines, this exception is thrown:
[EMAIL PROTECTED]:~$ python topsquid.py
On Thu, 03 Jan 2008 11:38:48 -0300, Bruno Ferreira wrote:
Hi,
I wrote a very simple python program to generate a sorted list of lines
from a squid access log file.
Here is a simplified version:
##
1 logfile = open (squid_access.log, r)
2 topsquid =