BLT Vector problem?

Nick Belshaw nickb at earth.ox.ac.uk
Tue Oct 10 09:39:40 EDT 2000


If anyone could check this out - and hopelfully help - I would be most
grateful...

I am using the BLT(2.4) package (very nice) with Python 1.5.2 / Pmw
0_8_3  on a Linux(RH6.2) box.

All very nice.
I am having problems with Vectors however - they won't be truncated.
I am continually appending data to a Vector and trimming it when it gets
too big.
In the code its length looks fine but it just grows and grows in memory.

e.g.

import Pmw, time
V1 = Pmw.Blt.Vector()
start = time.time()
while 1:
        if ((time.time()-start) > 5) and len(V1)>2000:
                print 'clipping at ',len(V1)
                clip_point = len(V1)-2000
                V1.set(V1[clip_point:])
                start = time.time()

- this just grows a Vector and every 5 secs truncates it to a length of
2000 if it is too big.
The Vector seems fine but just watch the process-id eat memory !!!
Likewise if I try to use __delslice__ or make a temporary vector and
__del__ and re-create.

Am I missing something here or is this a problem?
It certainly is a problem for me at the moment!!

cheers
Nick/Oxford





More information about the Python-list mailing list