equivalent to C pointer

2013-04-18 Thread abdelkader belahcene
Hi everybody, I am new to python and I am discovering it. I know C well, and want to know if python knows how to manage Pointers like pointer to function here is a C example how to write it in python Intergration with trapeze method When we write Trapeze ( at the compilation level) we don't

Re: equivalent to C pointer

2013-04-18 Thread Karim
Hello, There is no such notion in python. But the closest are iterators and generator functions. Cheers Karim On 18/04/2013 19:06, abdelkader belahcene wrote: Hi everybody, I am new to python and I am discovering it. I know C well, and want to know if python knows how to manage Pointers

Re: equivalent to C pointer

2013-04-18 Thread Chris Kaynor
While Python does not have pointers, Python functions are objects, and they may be passed like any other object: def F1(x): return x * x def Trapeze(Fonc, left, right, step): ...code... Y1 = Fonc(X1) ...code... def main(): ...code... y = Trapeze(F1, -2.5, 3.2, 0.1)

Re: equivalent to C pointer

2013-04-18 Thread abdelkader belahcene
Thanks for answer, but with C we can compile the trapeze function and put it in librairy, If we try to save the trapeze alone in package to import it later, I think, I am not sure it will be refused because F1 and sin are not define !!! this is the power of the C pointers !!! the link is

Re: equivalent to C pointer

2013-04-18 Thread David Robinow
On Thu, Apr 18, 2013 at 1:06 PM, abdelkader belahcene abelahc...@gmail.comwrote: Hi everybody, I am new to python and I am discovering it. I know C well, and want to know if python knows how to manage Pointers like pointer to function here is a C example how to write it in python

Re: equivalent to C pointer

2013-04-18 Thread Neil Cerutti
On 2013-04-18, abdelkader belahcene abelahc...@gmail.com wrote: Thanks for answer, but with C we can compile the trapeze function and put it in librairy, If we try to save the trapeze alone in package to import it later, I think, I am not sure it will be refused because F1 and sin are not

Re: equivalent to C pointer

2013-04-18 Thread David Robinow
On Thu, Apr 18, 2013 at 1:50 PM, abdelkader belahcene abelahc...@gmail.comwrote: Thanks for answer, but with C we can compile the trapeze function and put it in librairy, If we try to save the trapeze alone in package to import it later, I think, I am not sure it will be refused because

Re: equivalent to C pointer

2013-04-18 Thread Ian Kelly
On Thu, Apr 18, 2013 at 11:50 AM, abdelkader belahcene abelahc...@gmail.com wrote: Thanks for answer, but with C we can compile the trapeze function and put it in librairy, If we try to save the trapeze alone in package to import it later, I think, I am not sure it will be refused because

Re: equivalent to C pointer

2013-04-18 Thread Tim Chase
On 2013-04-18 18:07, Neil Cerutti wrote: There's no linking stage in Python. Everything you use must be defined before you use it. must be defined, only if you don't want an error. But in python, it isn't even REQUIRED that it be defined: some_undefined_function(args go here) will bomb out

Re: equivalent to C pointer

2013-04-18 Thread abdelkader belahcene
Thanks a lot, I think this does the task cheers On Thu, Apr 18, 2013 at 7:14 PM, David Robinow drobi...@gmail.com wrote: On Thu, Apr 18, 2013 at 1:50 PM, abdelkader belahcene abelahc...@gmail.com wrote: Thanks for answer, but with C we can compile the trapeze function and put it in