Re: how to read the last line of a huge file???

2011-01-28 Thread kost BebiX
26.01.2011, 12:59, "Xavier Heruacles" : > I have do some log processing which is usually huge. The length of each line > is variable. How can I get the last line?? Don't tell me to use readlines or > something like linecache... -- > http://mail.python.org/mailman/listinfo/python-list Well, it's

Re: how to read the last line of a huge file???

2011-01-27 Thread kost BebiX
27.01.2011, 15:55, "Roy Smith" : > In article ;, >  Alice Bevan–McGregor ; wrote: > >>  On 2011-01-26 02:59:26 -0800, Xavier Heruacles said: >>>  I have do some log processing which is usually huge. The length of each >>>  line is variable. How can I get the last line?? Don't tell me to use >>>  re

Re: Elliptic Curve Prime factorisation

2011-01-17 Thread kost BebiX
14.01.2011, 21:52, "mukesh tiwari" : > Hello all , I have implemented Elliptic curve prime factorisation > using wikipedia [ > http://en.wikipedia.org/wiki/Lenstra_elliptic_curve_factorization]. > I think that this code is not optimised and posting for further > improvement. Feel free to comment a

Re: unbalanced tree iteration issue

2011-01-14 Thread kost BebiX
14.01.2011, 20:19, "Ian Kelly" : > 2011/1/14 kost BebiX ;: > >>  Well, isn't tree is a root node and it's children? > > And its grandchildren, great-grandchildren, etc.  What Alex is saying > is that the implementation you posted traverses the root and its

Re: unbalanced tree iteration issue

2011-01-14 Thread kost BebiX
14.01.2011, 18:57, "Alex Boyko" : > 2011/1/14 kost BebiX >> 14.01.2011, 14:15, "Alex Boyko" : >> >>> Dear All! >>> >>> I have deal with large unbalanced trees and I have to implement post-order >>> tree traversal. My fir

Re: unbalanced tree iteration issue

2011-01-14 Thread kost BebiX
14.01.2011, 14:17, "Alex Boyko" : > Dear All! > > I have deal with large unbalanced trees and I have to implement post-order > tree traversal. My first attempt is shown below ("Node" and "Tree" classes) > and based on recursive generators approach. > > class Node(): >     def __init__(self,value)

Re: unbalanced tree iteration issue

2011-01-14 Thread kost BebiX
14.01.2011, 14:15, "Alex Boyko" : > Dear All! > > I have deal with large unbalanced trees and I have to implement post-order > tree traversal. My first attempt is shown below ("Node" and "Tree" classes) > and based on recursive generators approach. > > class Node(): >     def __init__(self,value)

Re: unbalanced tree iteration issue

2011-01-14 Thread kost BebiX
14.01.2011, 14:15, "Alex Boyko" : > Dear All! > > I have deal with large unbalanced trees and I have to implement post-order > tree traversal. My first attempt is shown below ("Node" and "Tree" classes) > and based on recursive generators approach. > > class Node(): >     def __init__(self,value)

Re: Rewriting __getattr__

2011-01-07 Thread kost BebiX
08.01.2011, 02:20, "Steven D'Aprano" : > On Fri, 07 Jan 2011 23:54:24 +0200, kost BebiX wrote: > >>  07.01.2011, 17:47, "Steven D'Aprano" >>  ;: >>>  On Fri, 07 Jan 2011 16:47:55 +0200, kost BebiX wrote: >>>>   Well, actually the

Re: Rewriting __getattr__

2011-01-07 Thread kost BebiX
07.01.2011, 17:47, "Steven D'Aprano" : > On Fri, 07 Jan 2011 16:47:55 +0200, kost BebiX wrote: > >>  Well, actually the code you showed doesn't work) > > Actually, it does. It just prints a warning message as well. Look > carefully: > >>

Re: Rewriting __getattr__

2011-01-07 Thread kost BebiX
07.01.2011, 23:48, "Fuzzyman" : > On Jan 7, 3:18 pm, kost BebiX ; wrote: > >>  07.01.2011, 17:14, "Jean-Michel Pichavant" ;: >>>  kost BebiX wrote: >>>>  šSorry for top posting, didn't know about that) I'm quote new to posting &

Re: Rewriting __getattr__

2011-01-07 Thread kost BebiX
07.01.2011, 17:14, "Jean-Michel Pichavant" : > kost BebiX wrote: > >>  Sorry for top posting, didn't know about that) I'm quote new to posting to >> mailing lists. >> >>  Well, actually the code you showed doesn't work) >>>>>

Re: Rewriting __getattr__

2011-01-07 Thread kost BebiX
07.01.2011, 16:22, "Jean-Michel Pichavant" : > kost BebiX wrote: > >>  You're absolutely right! Now try to do except Keyerror: raise >> AttributeError and it will also fail. But why? >> >>  07.01.2011, 15:45, "Jean-Michel Pichavant" ;: >&

Re: Rewriting __getattr__

2011-01-07 Thread kost BebiX
You're absolutely right! Now try to do except Keyerror: raise AttributeError and it will also fail. But why? 07.01.2011, 15:45, "Jean-Michel Pichavant" : > kost BebiX wrote: > >>  Hi everyone! >>  I just saw a bug (?) in bson.dbref:DBRef.__getattr__ >&g

Re: python only prints integers

2011-01-06 Thread kost BebiX
Well, that's because 20 is integer. To get float you can write 20.0 (or 20.). 20.0/8.0 = 2.5 8.0/3.0 = 2.6665 07.01.2011, 00:49, "francesco" : > I'm pretty new in Python language. I have a problem with numbers: it > seems python doesn't know any more how to count! > I get only the down

Rewriting __getattr__

2011-01-06 Thread kost BebiX
Hi everyone! I just saw a bug (?) in bson.dbref:DBRef.__getattr__ Here's they're code:     def __getattr__(self, key):     return self.__kwargs[key] And when you do copy.deepcopy on that object it will raise you KeyError. So here's a small piece of code that reproduces the problem: >>> clas