Future standard GUI library


B

Beinan Li

Not sure if this is the right place to talk about this. Even less sure if I
can
move this discussion to tkinter list, so here I am...

I know this may sound a silly question because no one can see the future.
But ...
Do you think tkinter is going to be the standard python built-in gui
solution as long as python exists?

I couldn't help but wonder if wx or PySide receives better py2 and py3
support, or anything else that prevent
them from getting into the standard python distributions, whether or not
this scene could start to shift ...

I believe this "which one of tkinter, wx, qt, is the best gui toolkit for
python" flame war has been going on
for ages. I love the fact that python ships a built-in gui solution which
makes shipping a pure-python desktop
application a viable choice. But tkinter does not appear to be the most
time-saving way to write a gui app.
The layout designer support, for one, is next to zero. I tried many
3rd-party designers
and loved PAGE (http://page.sourceforge.net) for a few minutes, then came
the author's comment:

"For release 4.0, I spent about two months working with the “Theme” part of
Ttk and have had only partial success. I now believe that the “Theme” part
of Ttk is really a very poor piece of software at all levels - concept,
implementation, and especially documentation. My guess is if it had been
well documented it would have been recognized by even the author as junk. I
find it hard to believe that the people who control Tcl/Tk allowed it in
the code base. I continue to support ttk because of the paned window,
notebook and treeview widgets."

And ttk seems to be a major attraction that keeps people coming back to tk
for the looks. This worries me very much
about whether I should start a gui app using python. Because if ttk is not
a "mature" technology, I'd avoid premature adoption.
If ttk is out of the question, tkinter will be too. I'd then be forced to
use a 3rd-party solution like wx or qt, which I really don't want to see.

Anyways, this is just some concerns that I hope someone may give his/her
opinions about.

Thanks!
 
Ad

Advertisements

K

Kevin Walzer

Hello,

I know this may sound a silly question because no one can see the
future. But ...
Do you think tkinter is going to be the standard python built-in gui
solution as long as python exists?

I don't see any significant clamoring among the Python core developers
to make a change.
I couldn't help but wonder if wx or PySide receives better py2 and py3
support, or anything else that prevent
them from getting into the standard python distributions, whether or not
this scene could start to shift ...

I am not going to engage in the old UI toolkit flame ware; I will limit
myself to factual observations and a few opinions about Tkinter without
placing it against other toolkits.

Python has the PEP process for suggesting changes to the core language
and libraries. Changing the default UI toolkit would require someone to
submit a proposal, get it approved, provide the implementation, and
commit to maintaining the implementation over the long term. You propose
it, you own it.

Thus far no one has done this. I would think the only person who would
be in a position to propose wxPython would be Robin Dunn since he is the
primary copyright holder, and to my knowledge he has never done so. As
for Pyside, it was not part of the transition of Qt from Nokia to Digia,
and so it appears to be orphaned. PyQt might be an alternative, but I
don't think Phil Thompson would ever submit it, as it would likely
affect his livelihood.

Given these facts, it's safe to say that Tkinter will remain the default
GUI toolkit in the stdlib for some years to come.
I believe this "which one of tkinter, wx, qt, is the best gui toolkit
for python" flame war has been going on
for ages. I love the fact that python ships a built-in gui solution
which makes shipping a pure-python desktop
application a viable choice. But tkinter does not appear to be the most
time-saving way to write a gui app.
The layout designer support, for one, is next to zero. I tried many
3rd-party designers
and loved PAGE (http://page.sourceforge.net) for a few minutes, then
came the author's comment:

PAGE strikes me as an odd choice for a Python developer to develop a Tk
UI. It's a descendent of the old Visual Tcl tool, and is run from Tcl
and not Python. VTcl was always famous for producing a huge pot of
spaghetti UI code that couldn't be easily modified outside the tool. I
have also tried many Tk UI tools including VTcl, SpecTcl, and the
orphaned tool from ActiveState, and have concluded that writing my own
code is both simpler and faster. As always, your mileage may vary.
"For release 4.0, I spent about two months working with the “Theme” part
of Ttk and have had only partial success. I now believe that the “Theme”
part of Ttk is really a very poor piece of software at all levels -
concept, implementation, and especially documentation. My guess is if it
had been well documented it would have been recognized by even the
author as junk. I find it hard to believe that the people who control
Tcl/Tk allowed it in the code base. I continue to support ttk because of
the paned window, notebook and treeview widgets."

The implementation of the ttk widgets is quite complex--that, in turn,
makes their documentation complex, and the complexity is a drawback.
It's hard to customize the ttk themes, especially compared to
customizing standard Tk widgets. I'm one of the core Tk developers, and
I don't fully understand the themed widgets' internals or how to
customize them. But it's not fair to say that they are "junk." The
author of PAGE may think so, but many would disagree. I think the
widgets work quite well, especially if used in their default mode. It's
difficult to overstate the improvement in the look and feel of my Tk
apps on the Mac when I switched to using the themed widgets.
And ttk seems to be a major attraction that keeps people coming back to
tk for the looks. This worries me very much
about whether I should start a gui app using python. Because if ttk is
not a "mature" technology, I'd avoid premature adoption.
If ttk is out of the question, tkinter will be too. I'd then be forced
to use a 3rd-party solution like wx or qt, which I really don't want to see.

ttk is a mature technology. The initial specification, code, and docs
were developed by Joe English nearly a decade ago (see
http://tktable.sourceforge.net/tile/tile-tcl2004.pdf), and they had been
accepted into Tcl/Tk's core in version 8.5 (released in 2007). The
earliest work on integrating these widgets into Python began in 2008,
and they were formally released in 2010. I would say that ttk is
mature, stable, and unlikely to undergo radical change in the future.

Guilherme Polo has done superb work in integrating the themed widgets
into Python--it's the most significant UI advance in Python's stdlib in
years. You are quite safe in developing against this API, unless your
taste simply does not run to using the ttk widgets.

Hope this helps,
Kevin
 
S

Steven D'Aprano

Do you think tkinter is going to be the standard python built-in gui
solution as long as python exists?
Probably.

I couldn't help but wonder if wx or PySide receives better py2 and py3
support, or anything else that prevent them from getting into the
standard python distributions, whether or not this scene could start to
shift ...

One of the major issues preventing projects being added to the standard
library is the maintenance schedule. Python's schedule for new releases
is quite conservative and slow. If, say, wxPython was added to the std
lib, it would have to follow Python's schedule:

* most backwards incompatible changes would be forbidden;

* those that are allowed would require a minimum of two major releases
(three years) before removing functionality;

* about four bug-fix releases (I think?) per year.

If a project is used to (say) weekly releases, dropping down to Python's
schedule can be rather painful.

Once something has been added to the standard library, it more or less
has to have a stable API, become conservative about changes, and care
more about backwards-compatibility than new features. Stability and
consistency become paramount. Many excellent, popular packages cannot
live under those restrictions, and so will never be part of the standard
library.

Tkinter is good in this regard, because it is a wrapper around Tk/Tcl,
which is equally stable and conservative as Python. Possibly even more so.
 
L

llanitedave

I'm curious about how commonly tkinter is actually used among Python app developers as compared to wx, Pyside, or PyQT. I get the impression that more distributed apps are built with wxPython, at least, than tkinter. My impression is far from actual knowledge, of course.
 
W

Wolfgang Keller

I know this may sound a silly question because no one can see the
future. But ...
Do you think tkinter is going to be the standard python built-in gui
solution as long as python exists?

"Standard built-in" maybe, but by far most people who need a GUI for an
actual application will keep using something else.
I couldn't help but wonder if wx or PySide receives better py2 and py3
support, or anything else that prevent
them from getting into the standard python distributions, whether or
not this scene could start to shift ...

Didn't Pyside have serious trouble recently, requiring a reanimation of
the project?
I believe this "which one of tkinter, wx, qt, is the best gui toolkit
for python" flame war has been going on
for ages.

If (Py)Qt wasn't so freaking fat, it might be the best.
If wxPython had a more pythonic (and stable?) API, it might be the best.
If PyGTK was more native on Windows and native at all on MacOS X, it
might be the best.
If PyGUI was more extensive, it might be the best.
This worries me very much about whether I should start a gui app
using python.

What other open-source cross-platform programming language choices do yo
have.

Java? For GUIs? Excuse me while I vomit.

C++? As a language for human beings? Oops, I have to throw up again.

Sincerely,

Wolfgang
 
Ad

Advertisements

C

Chris Angelico

What other open-source cross-platform programming language choices do yo
have.

Java? For GUIs? Excuse me while I vomit.

C++? As a language for human beings? Oops, I have to throw up again.

I personally like using Pike and GTK, so if I were to try a
cross-platform Python GUI project, I'd probably give PyGTK a shot. But
there's another option that is available to every platform and
(practially) every high level language: the web browser. Make your app
serve HTTP and do up your UI in HTML5/CSS3 - your facilities are
pretty extensive. Plus you get networking support for free! Obviously
this option isn't for everyone, but don't discount it out of hand.

ChrisA
 
L

llanitedave

I personally like using Pike and GTK, so if I were to try a

cross-platform Python GUI project, I'd probably give PyGTK a shot. But

there's another option that is available to every platform and

(practially) every high level language: the web browser. Make your app

serve HTTP and do up your UI in HTML5/CSS3 - your facilities are

pretty extensive. Plus you get networking support for free! Obviously

this option isn't for everyone, but don't discount it out of hand.



ChrisA

I've been thinking about that myself for some future app ideas. If you have a stand-alone app working from your web browser, don't you need an embedded web server to utilize the file system? Is a system like Django for an app overkill? Or is its embedded development server underkill for a single-user browser-based application?
 
C

Carlos Nepomuceno

You don't! If your app needs local content just use a regular open() (or your browser) to read the files and render them as you see fit.

For remote content you just need the 'urllib2' module or something like 'requests' module to get the data.

----------------------------------------
 
C

Chris Angelico

You don't! If your app needs local content just use a regular open() (or your browser) to read the files and render them as you see fit.

For remote content you just need the 'urllib2' module or something like 'requests' module to get the data.

BTW, forgot the link. The part you DO need is something like this:

http://docs.python.org/3/library/http.server.html

It takes care of the irrelevant and lets you just write your app. The
same sort of thing is available in quite a few languages. Great for
knocking something together quickly; not designed for thousand-TPS web
servers.

ChrisA
 
F

Fábio Santos

It would be way more practical to have an embedded browser. Appjs doesn't
even occupy a port on the client. We could totally benefit from that.
Django applications practically make themselves.
You don't! If your app needs local content just use a regular open() (or
your browser) to read the files and render them as you see fit.

For remote content you just need the 'urllib2' module or something like
'requests' module to get the data.

----------------------------------------
Date: Wed, 22 May 2013 19:31:55 -0700
Subject: Re: Future standard GUI library
From: (e-mail address removed) [...]

I've been thinking about that myself for some future app ideas. If you
have a stand-alone app working from your web browser, don't you need an
embedded web server to utilize the file system? Is a system like Django for
an app overkill? Or is its embedded development server underkill for a
single-user browser-based application?
 
Ad

Advertisements

W

Wolfgang Keller

But there's another option that is available to every platform and
(practially) every high level language: the web browser. Make your app
serve HTTP and do up your UI in HTML5/CSS3 - your facilities are
pretty extensive. Plus you get networking support for free! Obviously
this option isn't for everyone, but don't discount it out of hand.

Both the concept and actually implemented examples of so-called "web
applications" prove that they are just plain garbage and hopelessly
unusable for anything remotely resembling actual screenwork.

HTML forms may be at best useful for "web shops", but for actual
screenwork, HTML is not a valid GUI, no matter how much javascript you
add to it.

Sincerely,

Wolfgang
 
G

Grant Edwards

Both the concept and actually implemented examples of so-called "web
applications" prove that they are just plain garbage and hopelessly
unusable for anything remotely resembling actual screenwork.

What is "screenwork"?
 
W

Wolfgang Keller

Both the concept and actually implemented examples of so-called "web
All depends on your requirements.

Obivously, if your requirements are to be compliant with latest IT
management fads and to not give a darn for end-user productivity or
even legal requirements for screen workplace ergonomics...
For the Yosemite Project, I wanted the networking aspect, so the web
browser UI was a good one.

From the description this looks like a simble database CRUD
application. Somethign like that is definitely easier to implement and
to deploy and a *lot* more functional with any of the RAD frameworks
available for Python.

And just like HTML never was a valid GUI framework and never will be
one, HTTP will never be a suitable transport layer for a RPC protocol.

Sincerely,

Wolfgang
 
R

Roy Smith

Wolfgang Keller said:
HTTP will never be a suitable transport layer for a RPC protocol.

What, in particular, is wrong with HTTP for doing RPC? RPC is pretty
straight-forward. Take this method, run it over there, with these
arguments, and give me back the result. HTTP handles that just fine,
with your choice of XML, JSON, or whatever turns you on for the content
encoding.

There are protocols that are more efficient (mostly binary ones like
Thrift and Protocol Buffers), but for a lot of things, the simplicity
and convenience of HTTP is worth than the efficiency hit. It's really
nice to be able to slap together HTTP components like load balancers and
caches by just editing a few config files.
 
C

Carlos Nepomuceno

----------------------------------------
From: (e-mail address removed)
Subject: Re: Future standard GUI library
Date: Sun, 26 May 2013 19:43:10 +0200
To: (e-mail address removed) [...]
one, HTTP will never be a suitable transport layer for a RPC protocol.

Sincerely,

Wolfgang


Please give me an example of a "suitable transport layer for a RPC protocol".
 
Ad

Advertisements

C

Chris Angelico

From the description this looks like a simble database CRUD
application. Somethign like that is definitely easier to implement and
to deploy and a *lot* more functional with any of the RAD frameworks
available for Python.

And just like HTML never was a valid GUI framework and never will be
one, HTTP will never be a suitable transport layer for a RPC protocol.

No, it's basically a modified version of a file browser; you get a
directory listing, you can browse subdirectories, and selecting a file
causes an action to happen on the server. You also have some "action
buttons" that provide a measure of control: click a button and
something is done (eg a key is pressed, or a 'killall' command is
fired). The browser works just fine.

ChrisA
 
M

Michael Torrie

And just like HTML never was a valid GUI framework and never will be
one, HTTP will never be a suitable transport layer for a RPC protocol.

On good thing web development has brought us is the knowledge that
modularization and layers are a brilliant idea. Your back end exposes
services and business logic, and your front end can be in HTMLv5 and
Javascript, or QtQuick, PyGTK, or Visual Studio. If you do need a
native interface, it's a heck of a lot easier to rewrite just the
frontend then the entire stack. Who cares how the RPC is done; that's
an implementation detail. HTTP does happen to work well though. Why do
you say it is not suitable?
From the description this looks like a simble database CRUD
application. Somethign like that is definitely easier to implement and
to deploy and a *lot* more functional with any of the RAD frameworks
available for Python.

Chuckle. Simple CRUD, eh. Almost all apps involve database CRUD
interactions. And often in highly complex ways using business logic.

Maybe it would have been faster to develop, but ultimately less useful
and require more development time in the long run. suppose I now want
the app natively on my phone (because that's all the rage). It's an
iPhone. Oh. Apple doesn't support Python. Okay, rewrite the works,
including business logic, in Objective C. Now I want it on my android
phone. Oops rewrite the stack again in Java.

Since his application by nature is network oriented (client/server I
presume since he mentions multiple users), sticking it on a web server
and having the front end be separate (be it HTML or not) gives him the
flexibility to rapidly build native "screenable" UIs for his app on any
platform he chooses, something your philosophy does not allow for.
 
R

Roy Smith

Michael Torrie said:
On good thing web development has brought us is the knowledge that
modularization and layers are a brilliant idea.

Modularization and layers were a brilliant idea long before the web came
around.
 
Ad

Advertisements

I

Ian Foote

On 05/26/2013 11:43 AM, Wolfgang Keller wrote:
Maybe it would have been faster to develop, but ultimately less useful
and require more development time in the long run. suppose I now want
the app natively on my phone (because that's all the rage). It's an
iPhone. Oh. Apple doesn't support Python. Okay, rewrite the works,
including business logic, in Objective C. Now I want it on my android
phone. Oops rewrite the stack again in Java.
Kivy (http://kivy.org) is a python library that can be used to write
python apps for Linux, Windows, MaxOSX, Android and IOS.

Regards,
Ian F
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top