Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: Python: Python

Calling C or C++ Functions inside Python script

 

 

Python python RSS feed   Index | Next | Previous | View Threaded


parikshatdubey at gmail

Jul 4, 2009, 3:06 AM

Post #1 of 3 (364 views)
Permalink
Calling C or C++ Functions inside Python script

Hi,

Is this possible to call C functions(inbuilt or user defined) inside python
script.If yes, please illustrate how it can be done.
Thanks,
Parikshat Dubey
--
-----Fear not the path of truth, for the lack of people walking on it.


----Practice yourself, for heaven's sake, in little things; and thence
proceed to
greater.


clp2 at rebertia

Jul 4, 2009, 3:29 AM

Post #2 of 3 (325 views)
Permalink
Re: Calling C or C++ Functions inside Python script [In reply to]

On Sat, Jul 4, 2009 at 3:06 AM, Parikshat Dubey<parikshatdubey [at] gmail> wrote:
> Hi,
>
> Is this possible to call C functions(inbuilt or user defined) inside python
> script.If yes, please illustrate how it can be done.

The `ctypes` module:
http://docs.python.org/library/ctypes.html
Note: does not work w/ C++ directly.

Cheers,
Chris
--
http://blog.rebertia.com
--
http://mail.python.org/mailman/listinfo/python-list


tn.pablo at gmail

Jul 4, 2009, 6:25 AM

Post #3 of 3 (314 views)
Permalink
Re: Calling C or C++ Functions inside Python script [In reply to]

On Sat, Jul 4, 2009 at 05:06, Parikshat Dubey<parikshatdubey [at] gmail> wrote:
> Hi,
>
> Is this possible to call C functions(inbuilt or user defined) inside python
> script.If yes, please illustrate how it can be done.
> Thanks,
> Parikshat Dubey

>From http://www.swig.org :

"SWIG is a software development tool that connects programs written in C
and C++ with a variety of high-level programming languages. SWIG is used
with different types of languages including common scripting languages
such as Perl, PHP, Python, Tcl and Ruby. "


---
Pablo Torres N.
--
http://mail.python.org/mailman/listinfo/python-list

Python python RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact Gossamer Threads
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.