Re: C++ and Python

2007-03-09 Thread Mandus
are doing this quite extensively at work, and have found that in the long run SWIG is the best solution. OMMV, but if you ask me, the answer is SWIG. mvh, -- Mandus - the only mandus around. -- http://mail.python.org/mailman/listinfo/python-list

Re: numarray :: multiplying all the elements in 1d array

2005-12-20 Thread Mandus
even when 'a' is a plain python list. -- Mandus - the only mandus around. -- http://mail.python.org/mailman/listinfo/python-list

Re: After migrating from debian to ubuntu, tkinter "hello world" doesn't work

2005-11-30 Thread Mandus
30 Nov 2005 04:23:37 -0800 skrev [EMAIL PROTECTED]: > > Mandus ha escrito: > >> works just fine on my ubunty 5.10. Make sure you have the python2.4-tk >> package installed (sudo apt-get install python2.4-tk). >> > > yes, i got it. > It's a fresh instalation

Re: After migrating from debian to ubuntu, tkinter "hello world" doesn't work

2005-11-29 Thread Mandus
nter # with underscore, and lowercase 't' > import Tkinter # no underscore, uppercase 'T' > Tkinter._test() # note underscore in _test() works just fine on my ubunty 5.10. Make sure you have the python2.4-tk package installed (sudo apt-get install python2.4-tk). -- Mandus - t

Re: socket and os.system

2005-08-03 Thread Mandus
you Caps Lock? -- Mandus - the only mandus around. -- http://mail.python.org/mailman/listinfo/python-list

Re: pain

2005-08-03 Thread Mandus
code Java, be happy :-) mvh, -- Mandus - the only mandus around. -- http://mail.python.org/mailman/listinfo/python-list

Re: C++, Swig, and pyMPI

2005-08-02 Thread Mandus
se MPI also in your extension module? mvh, -- Mandus - the only mandus around. -- http://mail.python.org/mailman/listinfo/python-list

Re: map vs. list-comprehension

2005-06-30 Thread Mandus
Wed, 29 Jun 2005 08:33:58 -0700 skrev Scott David Daniels: > Mandus wrote: >> 29 Jun 2005 10:04:40 GMT skrev F. Petitjean: >> >>>Le Wed, 29 Jun 2005 09:46:15 + (UTC), Mandus a écrit : >>> >>>res = [ bb+ii*dd for bb,ii,dd in zip(b,i,d) ] >> >

Re: map vs. list-comprehension

2005-06-29 Thread Mandus
29 Jun 2005 10:04:40 GMT skrev F. Petitjean: > Le Wed, 29 Jun 2005 09:46:15 + (UTC), Mandus a écrit : >> Hi there, >> >> inspired by a recent thread where the end of reduce/map/lambda in Python was >> discussed, I looked over some of my maps, and tried to convert the

map vs. list-comprehension

2005-06-29 Thread Mandus
+ii*dd,b,i,d) which gives a list of length n. Anyone have an idea what the equivalent list comprehension will be? take care, -- Mandus - the only mandus around. -- http://mail.python.org/mailman/listinfo/python-list

Re: Favorite non-python language trick?

2005-06-29 Thread Mandus
Sun, 26 Jun 2005 08:35:58 +0200 skrev Peter Otten: > Steven D'Aprano wrote: > >> On Sat, 25 Jun 2005 21:30:26 +0200, Peter Otten wrote: >> >>> Mandus wrote: >>> >>>> By using the builtin reduce, I >>>> move the for-loop into the c-

Re: Favorite non-python language trick?

2005-06-25 Thread Mandus
ome of my test shows. But then I should probably write c-functions that deals with the numeric arrays anyway. Besides, functions like 'operator.add' is also in c, maybe that helps. But I admit it's not a perfect example. -- Mandus - the only mandus around. -- http://mail.python

Re: Favorite non-python language trick?

2005-06-25 Thread Mandus
Sat, 25 Jun 2005 21:30:26 +0200 skrev Peter Otten: > Mandus wrote: > >> By using the builtin reduce, I >> move the for-loop into the c-code which performs better. > > No. There is no hope of ever writing fast code when you do not actually > measure its performance. I

Re: How does one write a function that increments a number?

2005-06-25 Thread Mandus
need to be a function? Why complicate matters? Isn't it > simpler to just do this: [snip] I guess he have some reason for it... it's because python do call by value, not by reference for such simple variables. If you absolutely want to do this, you can try: def incr(counter): cou

Re: Favorite non-python language trick?

2005-06-25 Thread Mandus
; > > Couldnt there just be a "functional" module ?... > > from functional import map, filter, reduce but lambda is grammar, so probably not so easy to import? -- Mandus - the only mandus around. -- http://mail.python.org/mailman/listinfo/python-list

Re: Favorite non-python language trick?

2005-06-25 Thread Mandus
Sun, 26 Jun 2005 04:36:51 +1000 skrev Steven D'Aprano: > On Sat, 25 Jun 2005 17:41:58 +0200, Konstantin Veretennicov wrote: > >> On 6/25/05, Mandus <[EMAIL PROTECTED]> wrote: >>> It is really a consensus on this; that >>> removing map, filter, reduce is

Re: Favorite non-python language trick?

2005-06-25 Thread Mandus
s; that removing map, filter, reduce is a good thing? It will render a whole lot of my software unusable :( Sure, I guess I can port most of it to list comprehensions, but reduce/map are so much nicer. -- Mandus - the only mandus around. -- http://mail.python.org/mailman/listinfo/python-list

Re: Abstract and concrete syntax

2005-06-10 Thread Mandus
[snip] > > set_callback(obj, > lambda x: (if a: >2 > else: >3) > [snip] You can do stuff like this: lambda x: x and 2 or 3 Of course, you are still quite limited in what you can do, but it have solved some of my problems...

Re: Computer Cluster Python Software

2005-06-06 Thread Mandus
le effort. mvh, -- Mandus - the only mandus around. -- http://mail.python.org/mailman/listinfo/python-list