Re: [Tutor] Using C in python

2009-03-25 Thread Alan Gauld
"amit sethi" wrote what are the ways in which i can use C in python programs . You can't use C directly what you can do is access libraries written in C. In fact quite a few of the standard libraries are written that way. So it depends what you want to do. If you have C source code that yo

Re: [Tutor] Using C in python

2009-03-25 Thread Stefan Behnel
amit sethi wrote: > what are the ways in which i can use C in python programs . Here is a short example that uses Cython to call a couple of C functions in OpenGL and libc ("math.h"). The functions are declared in the "cdef extern" blocks at the top. http://misc.slowchop.com/misc/browser/muckarou

Re: [Tutor] Using C in python

2009-03-25 Thread Chris Fuller
There's a section in the Python docs just on this topic: http://docs.python.org/extending/index.html There's probably also some stuff in the wiki, although I'm not familiar with anything specific: http://wiki.python.org/moin/ The SWIG documentation is extensive, and while not the user-friendl

Re: [Tutor] Using C in python

2009-03-25 Thread Kent Johnson
On Wed, Mar 25, 2009 at 5:13 PM, amit sethi wrote: > what are the ways in which i can use C in python programs . I know there is > SWIG bindings are there any other . Also Could anyone explain how Swig > bindings work? There are quite a few options: SIP, SWIG and ctypes (in the std lib) build wr

[Tutor] Using C in python

2009-03-25 Thread amit sethi
what are the ways in which i can use C in python programs . I know there is SWIG bindings are there any other . Also Could anyone explain how Swig bindings work? -- A-M-I-T S|S ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listi