- Paperback: 552 pages
- Publisher: Manning Publications (March 1, 2006)
- Language: English
- ISBN-10: 1932394621
- ISBN-13: 978-1932394627
- Product Dimensions: 7.6 x 1.2 x 9.2 inches
- Shipping Weight: 2.2 pounds
- Average Customer Review: 35 customer reviews
- Amazon Best Sellers Rank: #1,158,728 in Books (See Top 100 in Books)
Enter your mobile number or email address below and we'll send you a link to download the free Kindle App. Then you can start reading Kindle books on your smartphone, tablet, or computer - no Kindle device required.
To get the free app, enter your mobile phone number.
Wxpython in Action Paperback – March 1, 2006
All Books, All the Time
Read author interviews, book reviews, editors picks, and more at the Amazon Book Review. Read it now
Customers who bought this item also bought
What other items do customers buy after viewing this item?
About the Author
Noel Rappin is a Senior Consultant at Obtiva. A Rails developer for five years, Noel has spoken at RailsConf and Windy City Rails, and is the author of Professional Ruby on Rails from Wrox Press. A blog relating to this book can be found at http://www.railsrx.com.
Top customer reviews
1. It is badly organized. Part I, called "Introduction to wxPython," deals with high-level abstractions and advanced topics. For example, Chapter 6, called "Working with the basic building blocks," is mainly concerned with constructing a drawing program, and doesn't discuss the most basic widgets in wxPython. Only in Part 2, starting on page 183, does the book "explore the essential widgets that make up the core of the wxPython toolkit." Who wants to wade through 182 pages before learning how to do basic things with wxPython?
2. The authors' explanations tend to be vague and incomplete, often omitting very basic information. For example, if I want a user to enter text into the program, then I'll want the program to get that text. Section 7.1.2 of this book, titled "How can I get the user to enter text?" doesn't show how to get the text that the user entered. In fact, the method for getting the text is GetValue() but in this book that is listed in the next section, titled "How do I change the text without user input?" (another example of bad organization). And I didn't find any explanation or example of how to use this very basic method. Another example: Section 7.1.2 says that the style wx.TE_PROCESS_ENTER triggers "a text enter event" when the user presses the enter key but doesn't give the name of this event or say where to find it; in fact it is in section 7.1.8 but you have to hunt to find it.
3. The index is weak. For example, suppose you want to find where wx.TextCtrl is discussed. If you look up "TextCtrl" in the index you won't find it; it is under "wx.TextCtrl." OK, but then the index refers you to pages "189-190, 192, 195, 198" whereas in fact all of pages 189-199 are concerned with wx.TextCtrl. Also, there are no subheadings in the index, so you can't tell from the index where to find specific information about a control.
I made much better progress when I abandoned this book and worked through the online tutorials. But those are very incomplete and I like working with books, so I've now ordered Cody Precord's book wxPython 2.8 Application Development Cookbook; I think I'll like that better.
The price is typical for programming books, and easily worth it for a professional programmer like me. I used an on-line version for about three days, at which point I realized that it was available as a paper book. I ordered it right away. The paper book is easier to use, and includes good illustrations and examples.
"WxPython in Action" is suitable for beginners and old pros. The examples are detailed and progress step by step. Full source code is available for download from the publisher's web site.
"WxPython in Action" covers the wxWidgets GUI system as implemented in Python. It is not a Python tutorial. If you are new to Python, I recommend also purchasing "Learning Python" by Lutz.
There are some useful bits in the book, but by and large it will be gathering dust on my bookshelf. The biggest disappointment is the index which is almost completely useless to me. If you are new to writing GUIs in general, this is a good book for getting started. If you're an experienced programmer there's not much to glean from this book.
As I tried to start work on a GUI application I've designed for my customer, I was frustrated by either the lack of or the poor quality of web-based documentation for wxPython. I decided to buy this book to help me get up to speed on the basics.
The book is definitely worth getting to help you get going doing basic wxPython programming. The demos that come with wxPython are great, but they are not good teaching tools for the basic principles. Realize that this book is only an introduction; there's no way they had enough room for a comprehensive treatise. I gave the book 4 stars only because I reserve 5 stars for books that I consider exceptional.
GUI (graphical user interface) toolkits are complex beasts. The learning curve to be able to do the things you want can be steep. Alas, there is no royal road to this knowledge. There are some things that can help, however. This book is certainly a good first step.
IMPORTANT: ignore the complaints of people who don't like this book and complain that it didn't help them do anything. I can tell the authors put a lot of work sweating over organization, pedagogy, what to include, examples, etc. You will get the basics of the information you need to pull yourself up by the bootstraps. Just don't expect to be able to turn to a page and have your application written for you -- things simply don't work that way. You will be expected to provide some sweat equity if you want to learn the ropes. The information is there -- I know, because I found it for myself. There will also be things that are missing that you think should be there -- the web can help you find those things.
Other things you should know about if you want to learn wxPython:
Definitely peruse and study the demos that come with wxPython. First, it will take you quite a bit of time just to go through them all since there are so many of them. You'll also be impressed with the creativity of the many folks who have made these contributions. Keep notes on the widgets that interest you most, as you'll want to go back later to find them and use them.
Manually laying out menus, dialogs, etc., via a text editor is tiresome. Get a tool like wxDesigner -- it can save you a lot of time and make it easier to make changes as your customers request them (or you see the need). Plus, all your resources for a project can go into one file. wxDesigner isn't a perfect tool (I'd like to see better documentation and more control over how things are done); however, it will pay for itself quickly if your time is valuable.
Check the wxPython wiki and FAQ. You will uncover answers to things you will struggle with.
wxPython comes with a tool called PyCrust that can help you discover things -- especially because of the lacking/poor wxPython reference documentation. In the directory I'm working in, I put a file named z.py that contains something like (Amazon's tool screws up the indenting):
#frame = wx.Frame(None)
app = MyApp()
frame = wx.MDIParentFrame(None)
window = wx.MDIChildFrame(frame)
panel = wx.Panel(frame)
button = wx.Button(frame)
textbox = wx.TextCtrl(frame)
togglebutton = wx.ToggleButton(frame)
toolbar = frame.CreateToolBar()
colorpicker = wx.ColourPickerCtrl(frame)
dialog = wx.Dialog(frame)
canvas = wx.Window(frame)
dc = wx.BufferedDC(wx.ClientDC(canvas))
brush = wx.Brush("black")
font = wx.Font(12, wx.SWISS, wx.NORMAL, wx.NORMAL)
I then start PyCrust and immediately type 'from z import *'. Now, if you look on the Namespace tab, you'll see a local variable tree. Click on the + and you'll expand the tree. Expand the variable of interest to see the attributes and methods for that type. Click on a symbol name and in the frame to the right, you'll see useful information about that thing, such as the docstring. Example: if you used the above z.py file, click on frame, then click on BackgroundColour. You'll see some details on this method. This will be your Obi Wan Kenobi when the documentation has let you down. A minor nit is that you'll often see C++ documentation rather than python, but it's pretty easy to figure things out.
Even with these resources, expect to spend a lot of time puzzling over things, cursing the lack of good documentation. But you'll eventually find what you need. In spite of the poor documentation, I'm extremely grateful for the powerful tool that is available, put together by lots of dedicated and hard-working volunteers.
In a couple of weeks, I've gotten most of a program I've envisioned for my customer working. It's going to be a very powerful tool for manipulating waveforms (partly because it uses numpy). I suspect they're going to be pretty surprised by the rich functionality in the prototype they see next week.
Most recent customer reviews
Its like the cliffs notes to the cliffs notes to the complete guide.Read more