Use of Interrogate

Can somebody explain me how to use interrogate.
Have I just to call interrogate mypandafile.cpp and vola there is a python file.
Is this file just a wrapped c++ file or does this file calles functions from a dll or an equal.

Thanks Martin

Well, in a nutshell, you do something like this:

interrogate [options] mypandafile.cpp myotherpandafile.cpp
interrogate_module [options]

Then you end up with a file like libmypanda_module.cpp, which you have to compile. Then you link all of these up together into one dll, and you can then import the dll into your Python process and it can be used as if it were a Python module (even though it’s really compiled C++ code).

The [options] for interrogate and interrogate_module are big and complicated, and depend partly on your OS and partly on what exactly you are compiling and what its relationship is to the rest of the Panda code.

If what you want is to integrate new code with Panda, it’s probably best to integrate it with the existing Panda build scripts–either ppremake or makepanda–which already know how to generate the appropriate interrogate commands. In fact, ppremake in particular is designed to allow you to add additional modules on top of the existing Panda codebase.

On the other hand, you might also simply decide to use some other tool to integrate your C++ with Python, like SWIG.

David

Thanks for all that.
Does SWIG just wrap C/C++ to python?
I have a version of SWIG integrated in Cygwin will this work if I run swig fom cygwin bash and use the result from ppython called also from cygwin bash.

Thanks Martin

SWIG is a process similar to interrogate, actually–you run it on your source code, and it produces new C++ source code that you have to compile and link in with your existing code. But it’s far better documented than interrogate. :slight_smile:

It does C/C++ to languages other than Python. I don’t know about using Cygwin SWIG; it probably has a good chance of working (but you might need to get the version that corresponds exactly to your version of Python). In fact, I know little more than this about SWIG specifically, since I’ve never used it myself, but they do have a community of people that can answer questions like this better than I can. :slight_smile:

David