[Code Challenge] WxPython versus Tkinter.


R

rantingrick

WxPython versus Tkinter (A code battle to the death!)

by Rick Johnson.

I have in many threads declared that Tkinter (and TclTk) is currently
--and has been for a decade-- the wrong choice for Python's stdlib
GUI. Throughout the 90's Tkinter was fine. However we have been in the
21st century for more than a decade and Tkinter is no longer relevant.
Many people have argued (weakly) that Tkinter is still valid. However
their arguments have been mostly baseless opinions that sadly lack
vision for the future.

In this thread i intend to slay my enemies with cold hard facts based
on code. It is time to put your code where your mouth is (or you
foot). This will be an open challenge to *anyone* in this community,
in the world, and *even* the great Guido van Rossum himself! It is now
time for you (python community) to prove the worth of Tkinter or
accept its demise at my hands!

Some of you may think this sounds like an impossible challenge. How
can one man defend his position against the entire world! Yes, it
would seem impossible for one man to face an entire community in open
challenge! And in most cases only a fool would challenge the world.
However, i have not one ounce of fear within me while facing these
odds because my position is the correct position. My position is based
on facts and NOT friendship, truth and NOT tantrums, and finally
vision NOT vengance! I am on the correct side of history!

It is time to prove once and for all how dated and worthless Tkinter
is compared to wxPython. Yes, WxPython is not as advanced as i would
like it to be for a 21st century GUI library. However compared to
Tkinter, Wx is light years ahead! Wx is our best hope to move Python
into the 21st century.

So now is the time for all you naysayers, trolls, and minions to face
me in mortal combat within the arena of truth and righteousness. Ready
your minds and wield your text editors for we shall battle for the
glory of Python! And when i have slayed the fools with their own
foolishness then ye all shall be enlightened!

So PUT UP OR SHUT THE HELL UP!


---------------------------------------
Challenge 1: (Simple Directory Viewer)
---------------------------------------

Create a simple Directory Viewer GUI. You CANNOT use a treectrl! The
point of this challenge is to show that Tkinter has no support for a
true ListCtrl widget. However the Wx::ListCtrl is fully featured! For
wxPython the code is simply wielding a few built in classes. For
Tkinter no such ListCtrl functionality exists. You CAN create the
functionality yourself (and i know this because i HAVE created it!)
however it involves tons of work and still can't hold a candle to the
wx::ListCtrl

---------------
Requirements:
---------------

How the user navigates to a folder is not important but you must
display the list of files/folders in two view modes with icons;

1. Display files in both ReportView and ListView.

* Reportview:
...scrollable vertical list with three columns.

* Listview:
...scrollable horizontal-ly wrapping list.

Note: If you do not understand the view modes just run my code for an
example. But the user must be able to switch between these two modes
easily. How the switching is done is unimportant -- I simply used two
buttons.

2. Columns
* Minimum of three cols; Name, Size, and Type (reportview).
* the "Name" column must include an icon AND label (both views).
* columns must be sortable by the user (reportview).
* columns must be sizable by the user (reportview).

3. Items
* All must be editable in place (no popup editing allowed!).
* All items must be selectable/deselectable by user.
* All items must be delete-able by the user.

That is the challenge. Step forth and battle if you can!

-----------------
WxPython code:
-----------------

https://sites.google.com/site/thefutureofpython/home/code-challenges


I await any challengers...
 
Ad

Advertisements

T

Terry Reedy

On 1/22/2011 7:07 PM, rantingrick wrote:

Near the beginning of this thread, I gently challenged you to produce a
concrete, practical proposal for an stdlib addition that could be
critiqued and improved. When you asked for problems with
wxwidgets/wxpython, I gave some. Still waiting.
 
O

Octavian Rasnita

From: "rantingrick said:
WxPython versus Tkinter (A code battle to the death!)

by Rick Johnson.

I have in many threads declared that Tkinter (and TclTk) is currently
--and has been for a decade-- the wrong choice for Python's stdlib
GUI. Throughout the 90's Tkinter was fine. However we have been in the
21st century for more than a decade and Tkinter is no longer relevant.
Many people have argued (weakly) that Tkinter is still valid. However
their arguments have been mostly baseless opinions that sadly lack
vision for the future.

In this thread i intend to slay my enemies with cold hard facts based
on code. It is time to put your code where your mouth is (or you
foot). This will be an open challenge to *anyone* in this community,
in the world, and *even* the great Guido van Rossum himself! It is now
time for you (python community) to prove the worth of Tkinter or
accept its demise at my hands!

Some of you may think this sounds like an impossible challenge. How
can one man defend his position against the entire world! Yes, it
would seem impossible for one man to face an entire community in open
challenge! And in most cases only a fool would challenge the world.
However, i have not one ounce of fear within me while facing these
odds because my position is the correct position. My position is based
on facts and NOT friendship, truth and NOT tantrums, and finally
vision NOT vengance! I am on the correct side of history!

It is time to prove once and for all how dated and worthless Tkinter
is compared to wxPython. Yes, WxPython is not as advanced as i would
like it to be for a 21st century GUI library. However compared to
Tkinter, Wx is light years ahead! Wx is our best hope to move Python
into the 21st century.

So now is the time for all you naysayers, trolls, and minions to face
me in mortal combat within the arena of truth and righteousness. Ready
your minds and wield your text editors for we shall battle for the
glory of Python! And when i have slayed the fools with their own
foolishness then ye all shall be enlightened!

So PUT UP OR SHUT THE HELL UP!


---------------------------------------
Challenge 1: (Simple Directory Viewer)
---------------------------------------

Create a simple Directory Viewer GUI. You CANNOT use a treectrl! The
point of this challenge is to show that Tkinter has no support for a
true ListCtrl widget. However the Wx::ListCtrl is fully featured! For
wxPython the code is simply wielding a few built in classes. For
Tkinter no such ListCtrl functionality exists. You CAN create the
functionality yourself (and i know this because i HAVE created it!)
however it involves tons of work and still can't hold a candle to the
wx::ListCtrl

---------------
Requirements:
---------------

How the user navigates to a folder is not important but you must
display the list of files/folders in two view modes with icons;

1. Display files in both ReportView and ListView.

* Reportview:
...scrollable vertical list with three columns.

* Listview:
...scrollable horizontal-ly wrapping list.

Note: If you do not understand the view modes just run my code for an
example. But the user must be able to switch between these two modes
easily. How the switching is done is unimportant -- I simply used two
buttons.

2. Columns
* Minimum of three cols; Name, Size, and Type (reportview).
* the "Name" column must include an icon AND label (both views).
* columns must be sortable by the user (reportview).
* columns must be sizable by the user (reportview).

3. Items
* All must be editable in place (no popup editing allowed!).
* All items must be selectable/deselectable by user.
* All items must be delete-able by the user.

That is the challenge. Step forth and battle if you can!



I have downloaded that simple program, launched it, and I've tested it with JAWS screen reader.
It was fully accessible out of the box.

Have you done something special for making it accessible for screen readers? (I guess not).

Can be the same thing done with Tkinter?

Octavian
 
S

Stefan Behnel

rantingrick, 23.01.2011 01:07:
I have in many threads declared that Tkinter (and TclTk) is currently
--and has been for a decade-- the wrong choice for Python's stdlib
GUI. [...]
It is time to prove once and for all how dated and worthless Tkinter
is compared to wxPython.

What's the aim of that prove? If you are trying to pave the ground for
getting wxPython in the stdlib instead of tkinter, I think that's bound to
fail. Similar proposals have been rejected with the simple argument that
adding a large library with a huge C dependency to the standard library
without having a rock solid maintainer for both of them is not going to happen.

Are you volunteering to maintain both wxPython and wxWidgets in the
standard library for, say, twenty years to come?

Stefan
 
R

rusi

WxPython versus Tkinter (A code battle to the death!)

by Rick Johnson.

I have in many threads declared that Tkinter (and TclTk) is currently
--and has been for a decade-- the wrong choice for Python's stdlib
GUI. Throughout the 90's Tkinter was fine. However we have been in the
21st century for more than a decade and Tkinter is no longer relevant.
Many people have argued (weakly) that Tkinter is still valid. However
their arguments have been mostly baseless opinions that sadly lack
vision for the future.

In this thread i intend to slay my enemies with cold hard facts based
on code. It is time to put your code where your mouth is (or you
foot). This will be an open challenge to *anyone* in this community,
in the world, and *even* the great Guido van Rossum himself! It is now
time for you (python community) to prove the worth of Tkinter or
accept its demise at my hands!

Some of you may think this sounds like an impossible challenge. How
can one man defend his position against the entire world! Yes, it
would seem impossible for one man to face an entire community in open
challenge! And in most cases only a fool would challenge the world.
However, i have not one ounce of fear within me while facing these
odds because my position is the correct position. My position is based
on facts and NOT friendship, truth and NOT tantrums, and finally
vision NOT vengance! I am on the correct side of history!

It is time to prove once and for all how dated and worthless Tkinter
is compared to wxPython. Yes, WxPython is not as advanced as i would
like it to be for a 21st century GUI library. However compared to
Tkinter, Wx is light years ahead! Wx is our best hope to move Python
into the 21st century.

So now is the time for all you naysayers, trolls, and minions to face
me in mortal combat within the arena of truth and righteousness. Ready
your minds and wield your text editors for we shall battle for the
glory of Python! And when i have slayed the fools with their own
foolishness then ye all shall be enlightened!

So PUT UP OR SHUT THE HELL UP!

---------------------------------------
 Challenge 1: (Simple Directory Viewer)
---------------------------------------

Create a simple Directory Viewer GUI. You CANNOT use a treectrl!  The
point of this challenge is to show that Tkinter has no support for a
true ListCtrl widget. However the Wx::ListCtrl is fully featured! For
wxPython the code is simply wielding a few built in classes. For
Tkinter no such ListCtrl functionality exists. You CAN create the
functionality yourself (and i know this because i HAVE created it!)
however it involves tons of work and still can't hold a candle to the
wx::ListCtrl

---------------
 Requirements:
---------------

How the user navigates to a folder is not important but you must
display the list of files/folders in two view modes with icons;

 1. Display files in both ReportView and ListView.

  * Reportview:
    ...scrollable vertical list with three columns.

  * Listview:
    ...scrollable horizontal-ly wrapping list.

Note: If you do not understand the view modes just run my code for an
example. But the user must be able to switch between these two modes
easily. How the switching is done is unimportant -- I simply used two
buttons.

 2. Columns
  * Minimum of three cols; Name, Size, and Type (reportview).
  * the "Name" column must include an icon AND label (both views).
  * columns must be sortable by the user (reportview).
  * columns must be sizable by the user (reportview).

 3. Items
  * All must be editable in place (no popup editing allowed!).
  * All items must be selectable/deselectable by user.
  * All items must be delete-able by the user.

That is the challenge. Step forth and battle if you can!

-----------------
 WxPython code:
-----------------

https://sites.google.com/site/thefutureofpython/home/code-challenges

I await any challengers...

Tried the code with debian sid and default python (2.6)

I get (after some loading... statements)

Segmentation fault

[Actually this is the first time in my 10 years of python that Ive
seen a pure python module segfault :) ]
 
S

Steven D'Aprano

 WxPython code:
[...]
Tried the code with debian sid and default python (2.6)

I get (after some loading... statements)

Segmentation fault

[Actually this is the first time in my 10 years of python that Ive seen
a pure python module segfault :) ]

wxPython is a front end to the wxWidgets (formerly wxWindows) toolkit,
which is C++. I imagine that's what seg faulted.
 
Ad

Advertisements

A

Adam Skutt

So PUT UP OR SHUT THE HELL UP!

You first. Write actual working code first and then you can challenge
people. I found 5 bugs in your code before I quit looking[1]. Can you
find and fix them all? Also, I'm entirely ignoring the bad styling,
bad default sizing, horrible UI, the fact you call rename "Edit", and
the fact the context menu doesn't do anything. All of the are
legitimate technical errors, i.e., you coded the program wrong.

In the spirit of community I open the bug finding to everyone, but
humbly ask you don't tell Mr. "rantingrick" Johnson about them. It
can be our little secret ;)

Adam

[1] I think there might even be more, but I got lazy.
 
R

rantingrick

On 1/22/2011 7:07 PM, rantingrick wrote:

Near the beginning of this thread, I gently challenged you to produce a
concrete, practical proposal for an stdlib addition that could be
critiqued and improved. When you asked for problems with
wxwidgets/wxpython, I gave some. Still waiting.

You may have done this however i do not remember. With all the
trolling that was going on (not you) i may have missed it.
 
R

rantingrick

I have downloaded that simple program, launched it, and I've tested it with JAWS screen reader.
It was fully accessible out of the box.
Excellent!

Have you done something special for making it accessible for screen readers? (I guess not).

I did nothing to make the code more accessible, that is just another
great attribute of 21st cenury GUI libraries.
Can be the same thing done with Tkinter?

Not that i am aware of.
 
A

Arndt Roger Schneider

rantingrick schrieb:

[snip]

1. You cannot define the terms--restrict your opponent--
and battle it yourselves.
2. Your specified directory browser is useless.
--At least define that the directory browser must have
constant complexity to work with volatile
data over a network...

-roger
 
R

rantingrick

WxPython versus Tkinter (A code battle to the death!)
by Rick Johnson.
I have in many threads declared that Tkinter (and TclTk) is currently
--and has been for a decade-- the wrong choice for Python's stdlib
GUI. Throughout the 90's Tkinter was fine. However we have been in the
21st century for more than a decade and Tkinter is no longer relevant.
Many people have argued (weakly) that Tkinter is still valid. However
their arguments have been mostly baseless opinions that sadly lack
vision for the future.
In this thread i intend to slay my enemies with cold hard facts based
on code. It is time to put your code where your mouth is (or you
foot). This will be an open challenge to *anyone* in this community,
in the world, and *even* the great Guido van Rossum himself! It is now
time for you (python community) to prove the worth of Tkinter or
accept its demise at my hands!
Some of you may think this sounds like an impossible challenge. How
can one man defend his position against the entire world! Yes, it
would seem impossible for one man to face an entire community in open
challenge! And in most cases only a fool would challenge the world.
However, i have not one ounce of fear within me while facing these
odds because my position is the correct position. My position is based
on facts and NOT friendship, truth and NOT tantrums, and finally
vision NOT vengance! I am on the correct side of history!
It is time to prove once and for all how dated and worthless Tkinter
is compared to wxPython. Yes, WxPython is not as advanced as i would
like it to be for a 21st century GUI library. However compared to
Tkinter, Wx is light years ahead! Wx is our best hope to move Python
into the 21st century.
So now is the time for all you naysayers, trolls, and minions to face
me in mortal combat within the arena of truth and righteousness. Ready
your minds and wield your text editors for we shall battle for the
glory of Python! And when i have slayed the fools with their own
foolishness then ye all shall be enlightened!
So PUT UP OR SHUT THE HELL UP!
Create a simple Directory Viewer GUI. You CANNOT use a treectrl!  The
point of this challenge is to show that Tkinter has no support for a
true ListCtrl widget. However the Wx::ListCtrl is fully featured! For
wxPython the code is simply wielding a few built in classes. For
Tkinter no such ListCtrl functionality exists. You CAN create the
functionality yourself (and i know this because i HAVE created it!)
however it involves tons of work and still can't hold a candle to the
wx::ListCtrl
How the user navigates to a folder is not important but you must
display the list of files/folders in two view modes with icons;
 1. Display files in both ReportView and ListView.
  * Reportview:
    ...scrollable vertical list with three columns.
  * Listview:
    ...scrollable horizontal-ly wrapping list.
Note: If you do not understand the view modes just run my code for an
example. But the user must be able to switch between these two modes
easily. How the switching is done is unimportant -- I simply used two
buttons.
 2. Columns
  * Minimum of three cols; Name, Size, and Type (reportview).
  * the "Name" column must include an icon AND label (both views).
  * columns must be sortable by the user (reportview).
  * columns must be sizable by the user (reportview).
 3. Items
  * All must be editable in place (no popup editing allowed!).
  * All items must be selectable/deselectable by user.
  * All items must be delete-able by the user.
That is the challenge. Step forth and battle if you can!

Tried the code with debian sid and default python (2.6)

I get (after some loading... statements)

Segmentation fault

[Actually this is the first time in my 10 years of python that Ive
seen a pure python module segfault :) ]

Congratulations genius! However if you are really smart you would have
read the note in the source that says "tested on windows only!".
Segfault. Thanks for the laugh!
 
Ad

Advertisements

R

rantingrick

On Jan 22, 7:07 pm, rantingrick <[email protected]> wrote:
You first.  Write actual working code first and then you can challenge
people.

The code does work. You just lack the skill to run it.
I found 5 bugs in your code before I quit looking[1].

What are these "so-called" bugs exactly? Remember this code is not
meant to WOW anyone. It is a challenge to anybody who can reproduce
the same functionality in Tkinter. The main point is to create a
ListCtrl that has two view modes, icons, and editable items. You lack
simple reading and comprehension skills Adam.
Can you
find and fix them all?  Also, I'm entirely ignoring the bad styling,

This is not a challenge about code styling.
bad default sizing,

This is not a challenge about pretty GUIs.
horrible UI, the fact you call rename "Edit",

pedantic troll!
and
the fact the context menu doesn't do anything.

THIS IS A SIMPLE EXAMPLE FILE VIEWER. We don't to actually rename and
delete files you moron. Get a life.

Adam you were one of the biggest trolls in the "other" thread. We
don't need you trolling up this one too. Can you write any code? I
have produced code and no one has offered a rebuttal using the Tkinter
module. This is because only a handful of the entire community has the
skills to create something like this with Tkinter. I am one of them,
Kevin is another, Guido is another, and there are a very few more.
HOWEVER YOU ARE NOT IN THIS GROUP ADAM. You are a troll, and that is
all you can do. Prove me wrong if you can...
 
R

rantingrick

rantingrick, 23.01.2011 01:07:
I have in many threads declared that Tkinter (and TclTk) is currently
--and has been for a decade-- the wrong choice for Python's stdlib
GUI.  [...]
It is time to prove once and for all how dated and worthless Tkinter
is compared to wxPython.

What's the aim of that prove? If you are trying to pave the ground for
getting wxPython in the stdlib instead of tkinter, I think that's bound to
fail. Similar proposals have been rejected with the simple argument that
adding a large library with a huge C dependency to the standard library
without having a rock solid maintainer for both of them is not going to happen.

Wait a minute, i am confused? What language is Python written in? Oh
thats right Lisp! I am so dumb. How did i even get this job? :)
Are you volunteering to maintain both wxPython and wxWidgets in the
standard library for, say, twenty years to come?

WxPython needs lots of proper documentation aimed at beginners (so
does Tkinter!). WxPython also needs a better API (however only VERY
sightly!!). These are some areas where i can be very helpful.
 
R

rantingrick

rantingrick schrieb:

[snip]

1. You cannot define the terms--restrict your opponent--
    and battle it yourselves.
2. Your specified directory browser is useless.
    --At least define that the directory browser must have
      constant complexity to work with volatile
      data over a network...

-roger

Get a life moron and post some code, if you can!
 
R

rantingrick

I await any challengers...


So far only trolls (besides Terry, Octavian, D'Aprano) have replied.
In my time here within the Python community i have only met one person
who shares my in-depth knowledge of Tkinter. That person is Kevin
Waltzer. So outside of Python-dev and Guido. Kevin and I are are the
ONLY people qualified to offer opinions on the worth or worthlessness
of Tkinter. If anyone in this entire community thinks that they also
are qualified then prove your worth by creating a ListCtrl in Tkinter
that mirrors the wxPython ListCtrl in functionality. When you have
done that, i will elevate you to my circle of enlightenment. Than and
only then shall i even entertain you BS.

Until then, anyone who tries to devalue my argument is just an
ignorant troll.
 
Ad

Advertisements

C

Corey Richardson

Tried the code with debian sid and default python (2.6)

I get (after some loading... statements)

Segmentation fault

[Actually this is the first time in my 10 years of python that Ive
seen a pure python module segfault :) ]

I also have a segfault. You should fix that, rantingrick :)
 
S

Steven D'Aprano

Wait a minute, i am confused? What language is Python written in? Oh
thats right Lisp! I am so dumb. How did i even get this job? :)

Python is written in C, Java, C#, Javascript, Haskell, Ocaml, and, yes,
even Lisp. There's even a Python interpreter written in Python.
Admittedly, the Ocaml implementation seems to be abandoned, and some of
the others are more experimental, but they're all Python.
 
A

Adam Skutt

The code does work. You just lack the skill to run it.

I not only possess the skill to run it, but to find fault it in
through simple inspection. All of the bugs I found, but one, I found
through reading the .py file. Heck, I'm so good that I guessed two of
the bugs before I downloaded the code because both are rank amateur
mistakes, and I'm not convinced you even rise to the level of amateur.
What are these "so-called" bugs exactly?

1. There's a bug related to loading of your resources.
2. There's a bug related to when file I/O is performed.
3/4. There's at least two bugs related to handling of a specific mouse
event.
5. There's a bug related to reporting errors to the user.

All of these bugs, except one[1], show a grave misunderstanding about
how GUI toolkits operate and/or how the underlying operating systems
behave.
Remember this code is not meant to WOW anyone.

That's apparent from simple inspection of the code! Not only does it
not wow, it doesn't even illustrate your own example to a degree that
could be reasonably considered competent. It demonstrates you didn't
even test the functionality you provided in your own code, or that if
you did, you're entirely clueless about GUI design fundamentals.
The main point is to create a
ListCtrl that has two view modes, icons, and editable items. You lack
simple reading and comprehension skills Adam.

And your code will not do that in a whole host of common situations
that a GUI application is reasonably expected to handle. It is not
sufficiently robust to be interesting.
Adam you were one of the biggest trolls in the "other" thread. We
don't need you trolling up this one too. Can you write any code? I
have produced code and no one has offered a rebuttal using the Tkinter
module. This is because only a handful of the entire community has the
skills to create something like this with Tkinter.

No, it's because your code is complete and utter shite and there's
zero point in attempting to replicate it. Your code does not work,
even if you think it does. I'm not the only person who's noted this.
HOWEVER YOU ARE NOT IN THIS GROUP ADAM. You are a troll, and that is
all you can do. Prove me wrong if you can...

I already have. Confirmation of some of the bugs I've noted exists in
this very thread. Thus, I'm quite capable of reading and
comprehending Python code. The same remains to be seen with you.

Adam

[1] Which is only because wxWidgets has a bug in this regard. That
being said, a workaround exists and trivial to find online.
 
Ad

Advertisements

R

rantingrick

1. There's a bug related to loading of your resources.
2. There's a bug related to when file I/O is performed.
3/4. There's at least two bugs related to handling of a specific mouse
event.
5. There's a bug related to reporting errors to the user.

Well then post a traceback.

However you still miss the point. You will do anything to distract
from the point. And what IS that point? Well that Tkinter is
lackluster 20 years old rotware and you need to resort to these BS
tactics to discredit me because 1). You cannot even create a Tkinter
GUI at the basic level, and 2) you have no real argument based on
facts!

Post CODE Adam. Code! Surely you can handle copy/pasting a traceback i
hope!
 

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