[PyKDE] Re: GUI wrapper for modules

Thorsten Kampe thorsten at thorstenkampe.de
Sun May 30 14:10:00 BST 2004

* Phil Thompson (2004-05-30 12:05 +0100)
> On Sunday 30 May 2004 10:48 am, Thorsten Kampe wrote:
>> For my first GUI Python application I thought of a wrapper for my
>> utility modules I have already written. Kind of "EasyGUI"[1] style but
>> much less sophisticated.
>> I've got a module "test.py" in $PYTHONPATH containing one function:
>> def multiply_by_two(x):
>>     return x * 2
>> Now the GUI app should do the following:
>> * import module test
>> * show one button with the following function:
>> When I click on the button display one input form where I can enter a
>> number and say "please enter a number". Then the application takes the
>> number executes test.multiply_by_two(number) and display the result
>> with message "the result is:"
>> If anyone could provide me with the appropriate Python/PyQt code (even
>> some "Pseudo Python code"), I'd be grateful.
> Have you looked at the tutorial examples that come with PyQt?

Yes, I've executed them and I've looked at the source code. Same with
the ones from "BlackAdder" (which seem to be a subset of PyQt's).
Seems to me like pretty clean code but unfortunately it's not
commented at all.

> They are  translations to Python of the Qt tutorials - and read the
> original Qt tutorials in the Qt documentation. 

Hm, the "Qt Tutorial #1 - The 14 Steps" seems interesting although the
code itself is C (or C++?) and I don't speak C. But I'd still prefer
some "working code" relating to my own modules, so I could "fiddle"
and experiment. "Analog clocks" - as beautiful as they are - seem to
me a bit "academic".


More information about the PyQt mailing list