Question about: GUI Builder for Tkinter and call to C/C++ code

Diez B. Roggisch deets at nospam.web.de
Fri Jul 11 11:59:55 CEST 2008


pauladospublicidad schrieb:
> First I'll introduce myself. I normally programm in C/C++ and Java.
> Sometimes I have to mix them (normally using C/C++ in java, because in
> java is easier to make portable graphic user interfaces). However to
> use C/C++ code in java is really complex and difficult.
> 
> Not too much time ago, I discover python. I had think to use it for
> developing portable graphic user intefaces, that will call my C/C++
> code / libraries / programs.
> 
> I had thought to use tkinter for making the GUIs, for portability and
> for not installing anything more than python. It's to say, for not
> adding more packages because I'm new in python and I don't now too
> much about install new packages.
> 
> I have seen that for wxpython there is gui builders (such as boa) but
> for tkinter I have not found anyon. I would like to know if anyone
> knows a GUI Builder for tkinter in order to develop my GUI's
> graphically and in a easier way.

AFAIK there is none, at least not usable with python. However, back when 
I did tk, I found it easy and clear enough (especially with the powerful 
layout managemnt) to hand-craft the GUI.

> Apart from this, I would like to call my C/C++ code / modulles /
> applications from python. I have read that python is implemented
> normally in C, so is easy to add new modules from C. I would like to
> find any tutorial / manual / link for dummies in order to make this
> (call my C code from python).

There are various options, depending on if you are real about using C, 
or if you are more into C++.

If you *can*, you should IMHO rely on a C-API (potentially layering a 
C++-lib). Then you can use the since python2.5 build-in ctypes-module to 
  access any DLL/shared library you like.

For extending and embedding, see the official docs:

http://docs.python.org/ext/ext.html

For C++ wrappers, there are several available:

  - SWIG
  - Boost::Python
  - SIP (used to wrap the great Qt gui toolkit)

I can personally recommend the latter, others MMV.

> Another solution could be to call the GUI made in python from C/C++
> code, but I'm sure this would be more complex.

You don't want this, no. It's possible, but needlessly complex.

HTH,

Diez



More information about the Python-list mailing list