WxPython tutorial

David Bolen db3l at fitlinxx.com
Wed Aug 9 17:40:33 EDT 2000


"Penfold" <spam at spam.com> writes:

> Yes, the demo thats in the wxPython distribution.  Run it, every "mini-demo"
> in it contains full source and tells you all you need to know ...

And even better it lets you see what it looks like right there :-)  Of
course, it's not so much a tutorial in the classical sense, but I
actually find it much more practical in terms of having stuff I can
directly use in my own applications.

For me, what I've found best in my approach towards picking up
wxPython was to have four sources of information available:

1. wxPython demo (in the 'demo' directory of wxPython)
2. wxWindows help documentation (in the 'docs' directory of wxPython)
3. wxPython installed modules (in the main and lib wxPython directory)
4. wxWindows/wxPython source. (retrieve from the wxWindows or wxPython site)


1. The demo is by far the easiest to start with since it's chock full
of code that you can interactively see run and then "borrow" the
actual code, either from the demo program's listing pane or from the
filesystem.  You can go quite a long way just depending on the demo -
you may not get every tiny little thing the way you want but it should
be really easy to get a functioning application.  Once you start
getting down the nitty gritty and having other questions, I find the
other sources to be the most useful in the order listed.

2. Although there are times when it can be ambiguous with respect to
wxPython (not quite everything that needs a wxPython note has one) or
even slightly out of whack with wxWindows itself, the wxWindows
documentation is really quite good, and it also includes some general
overviews.  The information is for the most part, directly
translatable to wxPython.

3. When in doubt about how wxPython wrapped something from wxWindows
(and it's not used in a demo the way I want to use it), I start with
the wxPython .py modules - looking through them can verify which
methods are wrapped and available (and I found particularly helpful
with the new grid class which isn't documented elsewhere yet).
However, at some point this doesn't help fully since the wrapper
doesn't show you precise parameters for all methods, just a generic
SWIG interface.  So then you go to...

4. The source is the final arbiter. :-) First, I'll look at the SWIG
interface files for wxPython which will let me know precisely what is
wrapped and how.  If something there is still unclear, I'll revert
back to the wxWindows source and see what actually happens for a class
or method (although this requires understanding C++ to follow fully).
And within the wxWindows source, there are also other direct wxWindows
samples that (again, requiring C++ knowledge) can provide some further
samples of operating code.


The vast majority of learning I did with (1) and (2) - I've only had
to delve into (3) and (4) occasionally, but it was really nice to have
them around when I needed to.

--
-- David
-- 
/-----------------------------------------------------------------------\
 \               David Bolen            \   E-mail: db3l at fitlinxx.com  /
  |             FitLinxx, Inc.            \  Phone: (203) 708-5192    |
 /  860 Canal Street, Stamford, CT  06902   \  Fax: (203) 316-5150     \
\-----------------------------------------------------------------------/



More information about the Python-list mailing list