Re: Memory leak in Python

2006-05-09 Thread Peter Tillotson
1) Review your design - You say you are processing a large data set, just make sure you are not trying to store 3 versions. If you are missing a design, create a flow chart or something that is true to the code you have produced. You could probably even post the design if you are brave enough. 2)

Re: Probability Problem

2006-04-25 Thread Peter Tillotson
I had a possibly similar problem calculating probs related to premium bond permutation. With 10^12 memory ran out v quickly. In the end I got round it by writing a recursive function and quantising the probability density function. Elliot Temple wrote: > Problem: Randomly generate 10 integers from

Re: multiline comments

2006-04-19 Thread Peter Tillotson
nice one Jorge :-) Jorge Godoy wrote: > Peter Tillotson wrote: > >> I'm not sure I agree, revision control is great but not the only answer. >> In multi-developer teams working on the trunk, it its kind of >> inconvenient if someone checks in broken code. It also

Re: multiline comments

2006-04-19 Thread Peter Tillotson
Ben Finney wrote: > "Atanas Banov" <[EMAIL PROTECTED]> writes: > >> Edward Elliott wrote: >>> Saying coders shouldn't use multiline comments to disable code >>> misses the point. Coders will comment out code regardless of the >>> existence of multiline comemnts. There has to be a better >>> argu

Re: Python advocacy in scientific computation

2006-02-17 Thread Peter Tillotson
Hi, Like it - an area that doesn't come out strongly enough for me is Python's ability to drop down to and integrate with low level algorithms. This allows me to to optimise the key bits of design in python very quickly and then if I still need more poke i can drop down to low level programmin

Re: python concurrency proposal

2006-01-03 Thread Peter Tillotson
I'd really like to see a concurrency system come into python based on theories such as Communicating Sequential Processes (CSP) or its derivatives lambda or pi calculus. These provide an analytic framework for developing multi thread / process apps. CSP like concurrency is one of the hidden gem

Re: Adding through recursion

2005-11-18 Thread Peter Tillotson
basically the other two points :-) you create a string of add functions add(2,4)--add(1,5)--add(0,6) only in the last ( add(0,6) ) explicitly returns y, in the else of add(1,5) you ignor it. If you want the starting add to return something sensible you need to find a way to pass it back up the

Re: Send password over TCP connection

2005-10-10 Thread Peter Tillotson
simplest approach is to 1 way hash the password ... perhaps using md5 normally with passwords the server only has to check if it is the same word, assuming the same hash algorithms the same hash value can be created at client. Its not hugely secure ... anyone sniffing can grab your hash value a

Re: Python profiler

2005-10-04 Thread Peter Tillotson
look in the gc module ... Celine & Dave wrote: > Hello All, > > I am trying to find a profiler that can measure the > memory usage in a Python program. I would like to > gather some statistics about object usages. For > example, I would like to be able to see how much time > it takes to search fo

Re: Advanced concurrancy

2005-08-01 Thread Peter Tillotson
also using the modules as mobile code rather than installing it formally. I'll probably zip the Axion directory and distribute the zip with the code, adding the zip to the python path dynamically. cheers p Michael Sparks wrote: > Peter Tillotson wrote: > > >>Hi, >> &

Re: Advanced concurrancy

2005-07-29 Thread Peter Tillotson
Cheers Guys, I have come across twisted and used in async code. What i'm really looking for is something that provides concurrency based on CSP or pi calculus. Or something that looks much more like Java's JSR 166 which is now integrated in Tiger. Peter Tillotson wrote: > Hi, >

Advanced concurrancy

2005-07-28 Thread Peter Tillotson
Hi, I'm looking for an advanced concurrency module for python and don't seem to be able to find anything suitable. Does anyone know where I might find one? I know that there is CSP like functionality built into Stackless but i'd like students to be able to use a standard python build. I'm tryi

Re: Detecting computers on network

2005-07-22 Thread Peter Tillotson
You could use a sniffer in promiscuous mode. pypcap -- or something like. This will record every packet seen by your network card. Whether is will work depends on whether you are on a true braodcast network. if a box is on and completely inactive you'll never see it, but most boxes do something

Re: Calculating average time

2005-07-08 Thread Peter Tillotson
have a look at the "timeit" module aswell GregM wrote: > Hi, > I'm hoping that someone can point me in the right direction with this. > What I would like to do is calculate the average time it takes to load > a page. I've been searching the net and reading lots but I haven't > found anything that

Re: importing packages from a zip file

2005-06-29 Thread Peter Tillotson
cheers Scott should have been from myZip.zip import base.branch1.myModule.py and no it didn't work, anyone know a reason why this syntax is not preferred ?? sorry posted the soln again, it works but feels nasty Scott David Daniels wrote: > Peter Tillotson wrote: > >> ... Wit

Re: importing packages from a zip file

2005-06-29 Thread Peter Tillotson
solution: have to add the zip archives to the PYTHONPATH, can be done in the env but also as below import sys, os.path zipPackages=['base.zip'] for package in zipPackages: sys.path.insert(0,os.path.join(sys.path[0],package)) import base.branch1.myModule Peter Tillotson wrote

importing packages from a zip file

2005-06-29 Thread Peter Tillotson
Hi all, I was wondering if this is possible. In python v2.3 the import systems was extended via PEP302 to cope with packages. *.py files in a directory hierarchy can be imported as modules each level in the directory hierarchy needs to contain at least an empty __init__.py file. eg. With the file