Re: Compile python code into a dll

2012-09-11 Thread Rolf Wester
Thank you all for your help. I'm going to try Cython. Regards Rolf On 10/09/12 14:15, Rolf Wester wrote: Hi, I have Python code that I would like to compile into a dll (I have to deliver a C/C++ callable dll and I don't want to reimpelement the Python code in C/C++). It's no

Compile python code into a dll

2012-09-10 Thread Rolf Wester
Hi, I have Python code that I would like to compile into a dll (I have to deliver a C/C++ callable dll and I don't want to reimpelement the Python code in C/C++). It's not for extending Python but I want to call the Python functions and classes from C/C++. It's more like extending C/C++ with

Re: exec

2012-03-01 Thread Rolf Wester
Thank you, that really made things much easier and admittedly much less nasty too. Regards Rolf On 01/03/12 18:14, Peter Otten wrote: > Rolf Wester wrote: > >> The reason to use exec is just laziness. I have quite a lot of classes >> representing material data and every cla

Re: exec

2012-03-01 Thread Rolf Wester
would mean quite a lot of writing I tried to do it with exec. With kind regards Rolf Wester -- http://mail.python.org/mailman/listinfo/python-list

exec

2012-03-01 Thread Rolf Wester
Error: sqr() takes exactly 2 arguments (1 given)). Is there a possibility to define methods using exec and getting normal behavior? I would be very appreciative for any help. With kind regards Rolf Wester -- http://mail.python.org/mailman/listinfo/python-list

Re: C-extension 2 times slower than exe

2009-06-24 Thread Rolf Wester
m0.160s 2) time used = 2.72 real0m3.454s user0m2.648s sys 0m0.164s It seems that there is an overhead of about 2 secs within the C++-code. I'm going to try this out with a problem that takes much more time than the present one. Regards Rolf Carl Banks wrote: > On Jun 23, 7:20 am

Re: C-extension 2 times slower than exe

2009-06-23 Thread Rolf Wester
Philip Semanchuk wrote: > > On Jun 23, 2009, at 9:51 AM, Rolf Wester wrote: > >> Hi, >> >> I have a C++ program that I would like to steer using Python. I made the >> wrapper using swig and linked the code (without the main function) into >> a shared objec

C-extension 2 times slower than exe

2009-06-23 Thread Rolf Wester
Hi, I have a C++ program that I would like to steer using Python. I made the wrapper using swig and linked the code (without the main function) into a shared object. My Python script loads the extension and calls a function of the C-extension, the rest runs entirely within the C-extension. For com

Tool for translating Matlab to Python?

2007-12-04 Thread Rolf Wester
Hi, is there a tool to automatically translate Matlab source to Python/numpy code? Regards Rolf -- http://mail.python.org/mailman/listinfo/python-list

Re: Memory problem

2007-11-16 Thread Rolf Wester
Hi, thank you for your comments and your hints (I probably deserve some kind of subtle irony). I found the problem: I thought a numpy array A has shape (n,) but actually it had shape (n,1). In the loop I sampled a value from that array: v.append(A[i]) So what happened was that I got a view of

Re: Memory problem

2007-11-15 Thread Rolf Wester
ve me hint on what I could try. Thank you in advance Rolf Diez B. Roggisch wrote: > Rolf Wester wrote: > >> Hi, >> >> I have a strange (for me) memory problem. When running a loop in a >> Python program memory usage increases from about 4% up to 100%. I do a >&g

Memory problem

2007-11-15 Thread Rolf Wester
Hi, I have a strange (for me) memory problem. When running a loop in a Python program memory usage increases from about 4% up to 100%. I do a gc.collect() every loop cycle but this doesn't help. There are about 67000 objects that are tracked by the garbage collector. This number does vary a li

concatenating numpy arrays

2006-10-31 Thread Rolf Wester
Hi, I want to concatenate two numpy arrays with shape (n1,n2) and (n1,n3) into a single array with shape (n1,n2+n3). I guess there is an elegant way to do this but I couldn't figure it out. So any help is very much appreciated. Regards Rolf -- http://mail.python.org/mailman/listinfo/python-l

Strange behaviour of Numeric Float32 array?

2006-07-12 Thread Rolf Wester
Hi, the code: from Numeric import * def my_minimum(a): n=shape(a)[0] x = 1.0e20 for i in range(n): if a[i] < x: x = a[i] return x def strange(a): a[3] = -6303.0 h = my_minimum(a) for i in range(10)

Re: Is there a Python __LINE__ ?

2006-07-06 Thread Rolf Wester
Thank you very much for your help. Regards Rolf -- http://mail.python.org/mailman/listinfo/python-list

Is there a Python __LINE__ ?

2006-07-06 Thread Rolf Wester
Hi, is there a Python aquivalent to the C __LINE__? Thank you in advance Regards Rolf -- http://mail.python.org/mailman/listinfo/python-list

Strange constructor behaviour (or not?)

2006-04-28 Thread Rolf Wester
or to create a new empty list every time it is called? Thanks in advance Rolf Wester -- http://mail.python.org/mailman/listinfo/python-list

Re: Python extension module segmentation fault

2005-10-21 Thread Rolf Wester
Robert Kern wrote: > > > Did you call import_array() in init_mytest()? > No I didn't. Thank you very much for your help. Now it works. With kind regards Rolf Wester -- http://mail.python.org/mailman/listinfo/python-list

Python extension module segmentation fault

2005-10-21 Thread Rolf Wester
: main (python.c:23) ==15792== ==15792== ERROR SUMMARY: 1 errors from 1 contexts (suppressed: 8093 from 7) ==15792== I would be very appreciative for any help. With kind regards Rolf Wester -- http://mail.python.org/mailman/listinfo/python-list

Re: plotting with Python

2005-05-31 Thread Rolf Wester
[EMAIL PROTECTED] wrote: > We use dislin in my lab. I don't think it's GPL... > > http://www.linmpi.mpg.de/dislin > Hi, thank you for your reply. I tried dislin but this didn't work very well for me. But I will try it again. Regards Rolf -- http://mail.python.org/mailman/listinfo/python-li

Re: plotting with Python

2005-05-31 Thread Rolf Wester
Philippe C. Martin wrote: > Look at wxPython > > Regards, > > Philippe > > I will do it, thank you for your reply. Rolf > > Rolf Wester wrote: > > >>Hi, >> >>I have a Python console application that is intended to be used >>intera

plotting with Python

2005-05-30 Thread Rolf Wester
elp. With kind regards Rolf Wester -- http://mail.python.org/mailman/listinfo/python-list

run region in IDLE

2005-01-02 Thread Rolf Wester
a way of doing it like it's possible with Emacs and Python. Is there any way of doing this? Regards Rolf Wester -- http://mail.python.org/mailman/listinfo/python-list

IDLE question

2004-12-26 Thread Rolf Wester
Hi, I would like to use IDLE as interactively as I can with Emacs. In Emacs I can send a marked region to the Python interpreter. Is there any way to do the same thing with IDLE? Thank you in advance Regards Rolf Wester -- http://mail.python.org/mailman/listinfo/python-list