Unix-head needs to Windows-ize his Python script

Grant Edwards invalid at invalid.invalid
Wed Oct 20 15:31:55 EDT 2010


On 2010-10-20, Shawn Milochik <shawn at milochik.com> wrote:
>
> On Oct 20, 2010, at 2:00 PM, Grant Edwards wrote:
>
>> On 2010-10-20, Shawn Milochik <shawn at milochik.com> wrote:
>> ript and execute its code, passing the arguments in.
>> 
>>> wxPython is just Python.
>> 
>> No, it's not.
>> 
>> You can't assume that any windows machine with Python installed also
>> has wxPython installed.  The only GUI kit that you can come close to
>> "assuming" is Tkinter.
>
> I didn't mean to imply that wxPython is in the standard library. Just
> that you write Python code when you create a wxPython app.

Ah, I see.  While that is true, the same statement can be made for all
of the GUI toolkits: PyQT, PyGTK, wxPython, pyFltk, etc.  When
creating a Python application using a GUI toolkit with a Python
binding, all you have to do is write Python.

> I recommended wxPython instead of Tkinter because of the opinions
> I've heard from other Python developers who prefer the former (I've
> never used Tkinter). Also, wxPython automatically looks native Mac,
> Windows, and Linux.

That's sort of true, but you've got to bundle the application
correctly on Windows to make it happen (it didn't "just work" the last
time I tried it).  The OP didn't seem interested in bundling his app.

I find Tkinter is much easier to use that wxPython for simple
applications, but I generally switch to wxPython for anything more
complex that a single top-level window with a handful of widgets in
it.  I also find the Tkinter API to be far more stable than wxWindows.
I've one slightly complex Tkinter application that I wrote 10 years
ago whose UI code is still running unchanged on brand new installs.

The main advantage of Tkinter is that it's the "standard" GUI library
for Python, and you can usually depend on it being installed on a
Windows machine if Python is installed.  It's included in both the
"standard" Windows installer and the ActiveState windows installer.
None of the other toolkits are.

If, like the OP, you don't want to bundle up your application with a
copy of Python and GUI libraries, Tkinter is pretty much your only
option.

-- 
Grant Edwards               grant.b.edwards        Yow! Am I accompanied by a
                                  at               PARENT or GUARDIAN?
                              gmail.com            



More information about the Python-list mailing list