Python from C/SDL

Gerhard Häring gerhard.haering at gmx.de
Fri Sep 6 19:44:21 EDT 2002


Gib Bogle wrote in comp.lang.python:
> Hi,
> 
> I am a complete beginner with Python.  My interest in it is focussed
> on a great piece of open-source software called pymol, a system for
> visualization of molecules that uses Python and OpenGL.  I'd like to
> get access to pymol's graphical functions from my own program, which
> is built from C, SDL and OpenGL.
> 
> I'm wondering if (with a bit of surgery) I'd be able to get access
> to the lower-level functionality of pymol, by which I mean the file
> I/O and rendering functions.

You'll have to embed Python
(http://www.python.org/doc/current/ext/embedding.html), load the pymol
modules and call functions or classes in it from C.

This means you'll have to get familiar with the Python/C API. The good
thing is that this is relatively easy. You should be able to find
documentation and examples on embedding Python. If you have any
particular questions on how to use the Python/C API, just ask here.

HTH,

Gerhard



More information about the Python-list mailing list