[mod_python] Executing c++ functions through psp

Graham Dumpleton graham.dumpleton at gmail.com
Thu Apr 17 03:59:36 EDT 2008

2008/4/17  <rahul.warhekar at edisphere.com>:
> hello all
>  I want to execute user defined function written in c++ using python server
>  pages.
>  i.e. give input to that function and exccept output from that function and
>  display that output on web page.
>  can any one help me with this?

You need to do what you would do if it was normal Python code. You
need to write a Python extension module. You can either do this
explicitly using Python C API:


or use tools such as SWIG:


or Python Boost library:


You also may be able to use ctypes module:


if you are lucky to map calls direct into DLL/shared library.

Since all this is independent of mod_python, perhaps better to ask
further questions on Python mailing list.



More information about the Mod_python mailing list