Please, how does 'Python, wxPython, wxWidgets, C++' all fit together?
WxWidgets being written in C++ and all.
What is actually being handed to Python when we use these things.
Thanks a bunch!

Recommended Answers

All 4 Replies

On Windows systems Python uses wx core DLLs written in C++, together with PYD files (similar to DLLs) and just plain old Python code, you might call these wrappers, to do its magic.

So, does python interpret source c++ files?
I see lots of *.h files in there.

The same thing for mac osx? What does mac have similar to dll files?
Thanks!

Wxwidgets is a toolkit for making GUIs in C++ and python cannot access that toolkit. What is done is; python language is "Glued" or bound to that C++ widgets so that you can access it using normal python code.

Wxpython is the glued version of wxWidgets. I don't know details of "gluing" process though!

So, does python interpret source c++ files?
I see lots of *.h files in there.

The same thing for mac osx? What does mac have similar to dll files?
Thanks!

No, Python does not touch the C++ source code. It links with the already compiled dynamic link libraries (.dll files on windows). These files have been compiled with a C++ compiler.

If you look at the wx directory, and sort the files by size, you will find that the largest files will be mostly .dll files. Actually, the same files that would be accessed if you would write a wxWindows GUI in C++.

Some of the Python files included provide a smooth access to the classes and methods contained in the dynamic link libraries, since you have to do a lot of argument passing and conversion to the proper C++ and Python types.

Other files have been created with the Simplified Wrapper and Interface Generator (SWIG). A tool that easily allows you to wrap C/C++ functions for use with scripting languages like Python. See:
http://www.swig.org/tutorial.html

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.