Re: Call C program

2009-12-03 Thread Grant Edwards
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

Re: Call C program

2009-12-03 Thread Dave Angel
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

Re: Call C program

2009-12-03 Thread Patrick Sabin
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

Re: Call C program

2009-12-03 Thread Daniel Fetchinson
> 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