Call C program

Patrick Sabin patrick.just4fun at gmail.com
Thu Dec 3 08:32:58 EST 2009


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 to call a C program 
> which needs one parameter and it returns another one.
> 
> How could I do it?
> 
> Thanks :)
> 




More information about the Python-list mailing list