On 2009-12-03, Patrick Sabin wrote:
>> I am developing a Python application and I need to call a C program
>> which needs one parameter and it returns another one.
> Have a look at the ctypes module
> http://python.net/crew/theller/ctypes/tutorial.html
Ctypes is great, except it's for calling
Patxi Bocos wrote:
Hi!,
I am developing a Python application and I need to call a C program which
needs one parameter and it returns another one.
How could I do it?
Thanks :)
You don't specify your python version, nor your OS. And you don't
really say what state that C program is in.
S
Have a look at the ctypes module
http://python.net/crew/theller/ctypes/tutorial.html
e.g.:
from ctypes import *
cdll.LoadLibrary("libc.so.6")
libc = CDLL("libc.so.6")
print libc.rand()
print libc.atoi("34")
- Patrick
Patxi Bocos wrote:
Hi!,
I am developing a Python application and I need t
> I am developing a Python application and I need to call a C program which
> needs one parameter and it returns another one.
You mean you need to call a C function from python? Here is an example
with a C function that adds two integers:
/* call this source file mymo