[Code Challenge] WxPython versus Tkinter.

rantingrick rantingrick at gmail.com
Sat Jan 22 19:07:31 EST 2011


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...






More information about the Python-list mailing list