473,809 Members | 2,780 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

GUI Frameworks in Python?

I've recently been trying out various different GUI frameworks in Python and
was wondering if I could get your input on the pros and cons of the
different ones...

wxPython: I love the programming side of wxPython, but I find it's just so
slow to initialise in the first place.

Tkinter: While it's fast to load up, the syntax has never really appealed to
me

GTK: Unknown - I'm looking into it today

Qt: I have yet to manage to install it on my system

Anything else?
Hugh Macdonald
Jul 18 '05
59 4322
Lothar Scholz wrote:
Peter Hansen <pe***@engcorp. com> wrote in message news:<qY******* *************@p owergate.ca>...

Go figure. (And as I said this is an AMD 2200 with 512MB RAM, XP Pro.)

You and all others miss one important number: What a harddisk are you
using ?
A notebook with a 4200rpm has a much lower startup time then a
7200rpm. It is as strange as a 10 against 2 seconds for the same
program on WinXP when compiled with Borland instead MS Visual C.


An excellent question...

My hard disk is a "lightning fast" Seagate 120GB 7200 RPM Serial-ATA
drive with liquid bearings and an 8MB cache...

Clearly it's those liquid bearings that make it so fast. ;-)

-Peter
Jul 18 '05 #41
Lars Heuer <py****@quixs.c om> schreef:
Another problem of Mozilla / XUL is, that you've to switch between
your programming languages: JavaScript for XUL and your favorite
programming language in the back. If your favorite programming lang
is JavaScript, you don't have to switch, of course. ;)


But look at what Mozilla.org are planning:
<http://www.mozilla.org/events/dev-day-feb-2004/mozilla-futures/langs.html>

--
JanC

"Be strict when sending and tolerant when receiving."
RFC 1958 - Architectural Principles of the Internet - section 3.9
Jul 18 '05 #42
Jørgen Cederberg <jo************ *@hotmail.com> wrote in message news:<Fq******* ********@news.g et2net.dk>...

Hi,

i downloaded and installed the GTK runtime environment v. 2.2.4-2 and
PyGTK 2.2.0 for Python 2.3. The installation went fine and I added the
path to GTK/lib and bin. I run a helloworld program, but unfortunely I
get this error message which I quite puzzled about (translated from danish)

(helloworld.py: 3308): Gtk-WARNING **: Could not find the theme engine in
module_path: 'wimp'

Does anyone have clue what to do?

Regards
Jorgen Cederberg


I had the same harmless warning and I moved libwimp.dll to
somewhere\GTK\2 .0\lib\gtk-2.0\2.2.0\engin es (a new directory, sister
of "loaders" and "immodules" ).

Lorenzo Gatti
Jul 18 '05 #43
Peter Hansen <pe***@engcorp. com> wrote in message news:<Xb******* *************@p owergate.ca>...
Running that repeatedly (sorry, can't reboot conveniently
right now, so can't get the first time) it takes 0.125 s
on my machine.


Nobody seems to have mentioned wxPython version numbers in this
discussion.

I just upgraded from 2.4.2.4 to 2.5.1.5, and the start-up time for the
demo app went from about 5 seconds to less than a second.
Chris
Jul 18 '05 #44
Chris Perkins wrote:
Peter Hansen <pe***@engcorp. com> wrote in message news:<Xb******* *************@p owergate.ca>...

Running that repeatedly (sorry, can't reboot conveniently
right now, so can't get the first time) it takes 0.125 s
on my machine.


Nobody seems to have mentioned wxPython version numbers in this
discussion.

I just upgraded from 2.4.2.4 to 2.5.1.5, and the start-up time for the
demo app went from about 5 seconds to less than a second.


I've been running 2.4.1.2 on Python 2.3.3... If I had the same
absolute speedup going to 2.5.1.5 it would be running before
I managed to click on its icon! ;-)

-Peter
Jul 18 '05 #45
Chris Perkins wrote:
I just upgraded from 2.4.2.4 to 2.5.1.5, and the start-up time for the
demo app went from about 5 seconds to less than a second.


Wow! I'd really like to know how this was accomplished. Do you know?
(Robin?)

Shane

Jul 18 '05 #46
Peter Hansen wrote:
Hugh Macdonald wrote:
I just wrote the following simple script:

-------------------------------------------------
#!/software/python/python2.2.2/linux/bin/python
import time
startTime = time.time()
from wxPython.wx import *
print "Time:",time.ti me()-startTime
-------------------------------------------------

On running multiple times, I get the following outputs:

Time: 4.60863804817
Time: 3.26165890694
Time: 3.24744296074
Time: 3.26767706871
Time: 3.25304102898


Running that repeatedly (sorry, can't reboot conveniently
right now, so can't get the first time) it takes 0.125 s
on my machine.


Just upgraded to the newly released (thank you so very much
for all your work Robin Dunn... now get back to that book! ;-)
2.5.1.5 to compare, sort of, with Chris Perkins' results.

Now it consistently takes 0.20 seconds to run the above on
my machine... how very odd.

-Peter
Jul 18 '05 #47
"Hugh Macdonald" <Hu***********@ brokenpipefilms .com> wrote in message news:<ma******* *************** *************** *@python.org>.. .
I've recently been trying out various different GUI frameworks in Python and
was wondering if I could get your input on the pros and cons of the
different ones...

wxPython: I love the programming side of wxPython, but I find it's just so
slow to initialise in the first place.

Tkinter: While it's fast to load up, the syntax has never really appealed to
me

GTK: Unknown - I'm looking into it today

Qt: I have yet to manage to install it on my system

Anything else?
Hugh Macdonald


Man, you better use PyGTK (http://pygtk.org). It's portable (See pygtk
faq for windows port). It's neet (API).
Try also `glade`, `libglade`.
http://glade.gnome.org , I think?
Jul 18 '05 #48
sr************* @yahoo.com (Sridhar R) wrote in message news:<93******* *************** ****@posting.go ogle.com>...

Man, you better use PyGTK (http://pygtk.org). It's portable (See pygtk
faq for windows port). It's neet (API).
Try also `glade`, `libglade`.
http://glade.gnome.org , I think?


Can someone outline some differences/advantages of PyGTK vs. wxPython?

A first look at PyGTK shows me a more Unix-like look-and-feel. On the
other hand, wxPython on Windows does look very much like any other
Windows applications.

Is the event handling in PyGTK cleaner/better than wxPython? Does
PyGTK have more widgets? The FAQ of PyGTK does not have a comparison
section regarding other GUI toolkits, I think it would be useful if
one were included. (If you go to wxPython's mainpage, you read "Why
the hell hasn't wxPython become the standard GUI for Python yet?", and
also "BTW, great work! I've definitively switched from Tk. I work on
Win32, anybody who works on Win32 should switch!". Comments like that.
Readers can immediately know the relationship to Tk, and wxPython's
platform friendliness for Win32.) Given the lack of comparison, I
would guess that GTK is unix-friendly, since Unix people usually would
mention little or nothing about Windows. :) Continuing with my guess:
are there any caveats for using PyGTK for Windows programmers?

---------------------------

Given my observations, is it fair to say:

(a) wxPython is widely used for Windows Python programmers, and
(b) PyGTK is widely used for Unix Python programmers?

regards,

Hung Jung
Jul 18 '05 #49
In article <ma************ *************** ***********@pyt hon.org>, Hugh Macdonald wrote:
I've recently been trying out various different GUI frameworks in Python and
was wondering if I could get your input on the pros and cons of the
different ones...

I would take a strong, close look at Tkinter again. In my opinion,
people have dismissed Tk as 'old technology', but I have seen
nothing else that remotely approaches the power of Tk.

First, a few points:
1) Tk at the moment looks ugly. There is a major
effort undergoing (tile--look on sourceforge) to
develop a themable Tk, and they already have
some very good-looking Windows-looking screenshots.
This won't be available in the immediate future,
but I think it won't be too too far off either.
The Tk community understands that the ugly,
nonstandard look is hurting Tk use.

2) Tkinter is a (relatively) thin layer over
Tk calls. The best way to use it is to build
some functions over it to do what you want
to do, and then reuse those functions.

3) Tkinter does make Tk into an object oriented
paradigm. So as you mention, you can subclass
a Tk widget and then pass in appropriate methods
of that class as functions. However, you often
don't even need to do this. A complex widget is
almost certainly going to be declared as a class
so just do:

class MyWidget(Frame) :
def __init__(self)
button1=Button( command=self.fo o1)
button2=Button( command=self.fo o2)

def foo1(event):...
def foo2(event):...

I can't remember if 'command' is the right option to Button,
but you get the idea.

3) People often complain about the Tk widget set not
being powerful enough. This is nonsense. First, read
through all of the man pages for the Text and Canvas
widgets--nothing else even comes close. (If something
does, please let me know). I've looked at QScintilla,
and it is far less flexible than Text. Then, download
the BLT addon package for Tcl/Tk and read through
its graph widget documentation. As for basic widget
sets, There may be a few widget types missing, but
it is very few, and what is missing can usually
be found in an Python extension (MegaWidgets) or
somewhere else, or coded fairly quickly using Tkinter.

4) The event-handling mechanism in Tk is awesome
It is very easy to specify not just single events,
but also "event sequences"; so, for example, you
can specify that ^X^S (the emacs save command)
saves your files.

5) As I mentioned above, it is often best to put
a nicer wrapper around some of the Tkinter stuff.
For example, here is the way I put things into a
gridded layout:

button = Button(...)
label = Label(...)
subframe = Frame(...)
mywidget = MyWidget(...)

grid([
[button, '-', label],
[subframe, 'x', '^'],
['^', mywidget, '-']
])

Which, using the captalized first letter of each
widget's variable, result in a layout like this:

BBL
S L
SMM
with the middle cell empty. The ^ and - characters
simply indicate that the cell in the previous
row/column should be carred into this cell. This
grid function (not method)
took me about 8 lines to write, and I've
put it up on the Tkinter mailing list hosted on
the Python web site.

Likewise, I'm in the process of writing something
to make event binding easier, and will put that
up when it's done. It will look something like:

bindevents(widg et,
ca_x_space_b1=f un1,
m_backspace=fun 2,
Y=fun3,
)

Which indicates that fun1 should be invoked on the
event sequence ctrl-alt-x ctrl-alt-space ctrl-mousebutton1;
fun2 on meta-backspace; and fun3 on the single key 'Y'.

There are a few problems with Tk. To use much of the
Tkinter stuff, you need to have the Tk man pages
handy, which is why writing more pythonic wrappers
is a good idea. There is a third-party table widget
available which is useful for relatively simple
applications, but which lacks the flexibility and
power of the Text and Canvas widgets. (Still, it's
better than a lot of other table implementations
I've seen.) However, once you've gotten over the
initial learning curve (which mostly has to do
with learning the Tk side, and isn't really that
bad--Brent Welch and a co-author have a brand new
book out which is just great), you can throw a
powerful UI together in an amzingly short time.

Cheers,
Ken
Jul 18 '05 #50

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

14
2715
by: mirnazim | last post by:
Hi, There are great Python Web Application Framework. But most of them are meant for content oriented web apps. Is there something that can ease the development of application that are not content oriented(I call them "NON CONTENT-ORIENTED WEB APPLICATIONS" because I don't know what else to call them). I mean the applications like, accounting, high volume data entry apps, where normally GUI clients have ruled. I know very high...
0
1268
by: Ravi Teja | last post by:
Why is no one talking about ActiveGrid, which at least on the surface seems to be the most polished way to build web applications in Python so far. They have a sound financial backing, $10 million when I last heard, made news on non-Python circles, have a relatively friendly authoring environment and are probably addressing the enterprise more specifically than any other web framework. It somehow did not grow on me but I would love to...
2
1316
by: Ed Leafe | last post by:
I may have an opportunity to develop an online ordering system for a client, and will have the ability to develop using any tool I choose. Given the fact that there are more web frameworks in Python than keywords ;-) , what I need to know is any experience anyone out there has had integrating credit card processing with the various Python web frameworks. Until now, my only practical experience is with Zope 2.x, but I'm open to any and all...
1
1383
by: GinTon | last post by:
I have created several tables in CSV format with globalization data (G11n). There are tables for countries, areas, languages, countries & languages, time zones, phones. And they are licensed under a Creative Commons license. http://svn.webda.python-hosting.com/trunk/G11n_data/ I created a new discussion group in order to facilitate the integration of G11n data in any framework. It's focused on integrate it on Django and TurboGears,...
4
1215
by: Shortash | last post by:
Hi Gurus, I want to build a Python web app but im not sure which one to go for. I prefer something like asp.Net , which would allow me to fully seperate the presentation layer from the logic. Please advise? thanks, "Shortash'
4
1946
by: Evan Klitzke | last post by:
Hi all, What frameworks are there available for doing pattern classification? I'm generally interested in the problem of mapping some sort of input to one or more categories. For example, I want to be able to solve problems like taking text and applying one or more tags to it like "romance", "horror", "poetry", etc. This isn't really my research specialty, but my understanding is that Bayesian classifiers are generally used for problems...
37
2586
by: Michele Simionato | last post by:
At work we are shopping for a Web framework, so I have been looking at the available options on the current market. In particular I have looked at Paste and Pylons and I have written my impressions here: http://www.phyast.pitt.edu/~micheles/python/yet-another-comparison-of-web-frameworks.html I do not speak too well of Pylons, so if you thing I am wrong feel free to correct me here ;)
29
1589
by: joe jacob | last post by:
There are a lot of web frameworks for python like django, mod_python, spyce, turbo gears, Zope, Cherrypy etc. Which one is the best in terms of performance and ease of study.
7
1444
by: Phillip B Oldham | last post by:
Are there any python micro-frameworks (like ruby's Camping)?
0
9721
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10640
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
10387
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
1
7662
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6881
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5689
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4332
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3861
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3015
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.