Best book/tutorial to learn wxPython?


As of 2022, what would you recommend for users who know Python more or less, and would like to write GUIs with wxPython?

As much as possible, I prefer books because they’re more structured and proceed step by step.

Noel Rappin and Robin Dunn’s “WxPython in Action” is from 2006: Is it still relevant, or is there more recent material you would recommend?

Thank you.

I would suggest to get the book. It’s still relevant.
For a start, I would suggest to work through the wxGlade tutorial.


Good to know nothing significant changed since 2006, as I much prefer books. Thank you.

Also, be sure to download and run the demo. It’s one of the most valueable resources.


You could also try

Cody Precord - wxPython Application Development Cookbook
Michael Driscoll - Creating GUI Applications with wxPython

You’d be wise to check out Mike’s other python books as well.

Thanks for the infos.

Cody Precord, “wxPython Application Development Cookbook”

Michael Driscoll, “Creating GUI Applications with wxPython”

Demo is the best learning source, in my opinion.

Thanks. It fails installing:

c:\>pip install -U wxPython
Requirement already satisfied: wxPython in c:\python38-32\lib\site-packages (4.1.1)
Collecting wxPython
  Downloading wxPython-4.2.0.tar.gz (71.0 MB)
     ---------------------------------------- 71.0/71.0 MB 1.1 MB/s eta 0:00:00
  Preparing metadata ( ... error
  error: subprocess-exited-with-error

  x python egg_info did not run successfully.
  │ exit code: 1
  ?─> [8 lines of output]
      Traceback (most recent call last):
        File "<string>", line 2, in <module>
        File "<pip-setuptools-caller>", line 34, in <module>
        File "C:\Users\fred\AppData\Local\Temp\pip-install-d4t45wyb\wxpython_b15bf1eb731144768793ca8ee4dd5089\", line 27,
in <module>
          from buildtools.config import Config, msg, opj, runcmd, canGetSOName, getSOName
        File "C:\Users\fred\AppData\Local\Temp\pip-install-d4t45wyb\wxpython_b15bf1eb731144768793ca8ee4dd5089\buildtools\
", line 30, in <module>
          from attrdict import AttrDict
      ModuleNotFoundError: No module named 'attrdict'
      [end of output]

  note: This error originates from a subprocess, and is likely not a problem with pip.
error: metadata-generation-failed

x Encountered error while generating package metadata.
?─> See above for output.

note: This is an issue with the package mentioned above, not pip.
hint: See above for details.

[notice] A new release of pip available: 22.3 -> 22.3.1
[notice] To update, run: python.exe -m pip install --upgrade pip

I’ll check it out, although I much prefer a book because of the logical progression.

wget -c

-U tells pip to upgrade wxPython, but you didn’t actually need to do that. The version 4.1.1 that you had before was fine. You got the error message because there are no pre-built 32-bit binaries for 4.2.0, only 64-bit ones, and so pip tries to build from source, and building from source isn’t quite so simple.

You can just go back with pip install wxPython==4.1.1. Or you might consider switching to a newer 64-bit Python. I recommend 3.10 64 bit.

Makes sense; thanks.