List Combinations

2008-03-12 Thread Gerdus van Zyl
I have a list that looks like this: [['3'], ['9', '1'], ['5'], ['4'], ['2', '5', '8']] how can I get all the combinations thereof that looks like as follows: 3,9,5,4,2 3,1,5,4,2 3,9,5,4,5 3,1,5,4,5 etc. Thank You, Gerdus -- http://mail.python.org/mailman/listinfo/python-list

Re: New UI Toolkit

2007-08-26 Thread Gerdus van Zyl
> But I'm afraid with the Swing-like interface, i.e : did you use the same > widget positionning ? Not sure what you mean, but each parent widget is responsible for rendering and positioning the children. Can use layout managers, two currently absolute and simple flow. ( In the screenshot, the

New UI Toolkit

2007-08-26 Thread Gerdus van Zyl
Hi I am halfway to a first release of a new GUI library for python. It will be cross platform and follows the Swing philosophy of user experience and interface fidelity above "but it doesn't look like windows!" (aside: neither does office 2007 or windowsmediaplayer). The library is built on top o

Re: pure python gaussian blur

2007-08-25 Thread Gerdus van Zyl
van Zyl Seperated Gaussian blur: def blurB(self): pixels = self.array temp1 = copy.copy(pixels) #temp2 = copy.copy(pixels) stride = self.width * 4 clr = array.array('B',[255,255,255,255]) w = self.width h = self.height

pure python gaussian blur

2007-08-14 Thread Gerdus van Zyl
Does anyone have a relatively fast gaussian blur implemented in pure python? Below is my attempt but it takes 2.9 seconds for a 320x240 image. Image comes from byte string: self.array = array.array('B',srcstring). Would some sort of matrix multiplication be faster? I don't have experience in that.

Optimizing numpy

2007-05-12 Thread Gerdus van Zyl
I have the following, that is used to convert pixel data and thus should be as fast as possible: b = numpy.ndarray (shape=(w,h,4), dtype=numpy.uint8) a = numpy.frombuffer(buf, numpy.uint8) a.shape = (w, h, 3) b[:,:,0] = a[:,:,2] b[:,:,1] = a[:,:,1] b[:,:,2] = a[:,:,0] b[:,:,3] = 255 Can anyone