- Restposten! - Jetzt zugreifen solange Vorrat reicht! Mehr englische Restposten.
wxPython in Action (Englisch) Taschenbuch – 30. März 2006
Hinweise und Aktionen
Wird oft zusammen gekauft
Kunden, die diesen Artikel gekauft haben, kauften auch
Es wird kein Kindle Gerät benötigt. Laden Sie eine der kostenlosen Kindle Apps herunter und beginnen Sie, Kindle-Bücher auf Ihrem Smartphone, Tablet und Computer zu lesen.
Geben Sie Ihre Mobiltelefonnummer ein, um die kostenfreie App zu beziehen.
How to build a state-of-the-art GUI using the wxPython toolkit. *co-authored by the toolkit's developer, Robert Dunn *the only published source for the wxPython toolkit *complete resource, including reference, tutorial and many unique examples of working with the code. Because they are often large and complex, GUI programming toolkits can be hard to use. xyPython is a combination of the Python programming language and the wxWidgets toolkit, which allows programmers to create programs with a robust, highly functional graphical user interface, simply and easily. wxPython combines the power of an exceptionally complete user interface toolkit with an exceptionally flexible programming language. The result is a toolkit that is unique in the ease with which complex applications can be built and maintained. wxPython in Action is a complete guide to the wxPython toolkit, containing a tutorial for getting started, a guide to best practices and a reference to wxPythons' extensive widget set. After an easy introduction to wxPython concepts and programming practices, the book takes an in-depth tour of when and how to use the bountiful collection of widgets offered by wxPython.All features are illustrated with useful code examples and reference tables are included for handy lookup of an objects properties, methods and events. The book enables developers to learn wxPython quickly and remains a valuable resource for future work.
Über den Autor und weitere Mitwirkende
Noel Rappin is a senior software engineer at Motorola and has extensive Python experience. He has a Ph.D. from the Georgia Institute of Technology, where he studied educational software and user interface design. Noel co-authored the book Jython Essential.
Robin Dunn, the creator and maintainer of WXPython has been working in the software industry for 18 years on a wide variety of applications. He discovered both wxWindows and Python in 1995 while looking for a cross platform toolkit and has never (willingly) looked back. Robin was awarded the ActiveState Programmers Choice Award at the 2002 O'Reilly Open Source Convention. Robin also worked for the Open Source Application Foundation, improving wxPython for use in their flagship product, Chandler.
Da wären einmal die mangelnde Unterstützung für Bitmaps wie png und jpeg und dass die Oberfläche bei Crossplatformdevelopment immer irgendwie 'fremd' auf dem 'Gast'-Betriebssystem aussieht (welches OS hat schon eine TK Oberfläche?)
Will man, dass die Python-Anwendung wie 'original' zu dem OS zugehörig aussieht, sollte man zu wxPython greifen. Dazu noch den Stani's Python Editor benutzen (wird im Buch leider nicht erwähnt), die Beispielscripte von der Manning-Website herunterladen und man wird sehr, sehr schnell erkennen, warum man künftig nur noch mit wxPython GUI-Anwendungen entwickeln will :-)
Ich für meinen Teil würde dem Buch am liebsten noch einen Punkt mehr verpassen, Schwachpunkte konnte ich nicht wirklich finden...
(Okay, vielleicht parent und child frame-Beziehungen und Handhabung der IDs könnten etwas plastische sein, aber wahrscheinlich liegt es daran, dass bei mir der Groschen noch nicht gefallen ist...)
Die Beispiele sind sehr gut gewählt und einfach an eigene Bedürfnisse anzupassen.
Einfache beginnend mit einfachen Okay-Infofenstern über Single-Choice-Selektor, Fortschrittsbalkenanzeige, Mainframes incl. aufbai der Hauptschleife, mit Toolbar und Statusleiste, Event-Handling werden im ersten Drittel erklärt, aber auch weiterführende grafische Anzeigen mit Grids, Sizer im 'Advanced wxPython' Teil.
Was das Buch nicht ist:
Eine Python Einführung!Lesen Sie weiter... ›
Das Buch ist sehr lebendig und äußerst anschaulich geschrieben.
Mit dem Englischen kam ich gut klar, einzelne unbekannte Vokabeln erklären sich leicht aus dem Kontext.
Es werden viele Hintergründe für die Art der Implementierung in WX dargelegt (liegt vielleicht daran, daß die Autoren WX für Python mit erschaffen haben). Gerade diese Infos sind sehr wichtig.
Grundlagenkenntnisse von Windows und allgemeiner Python-Programmierung sollten aber schon gerne vorher vorhanden sein. Mit den Informationen des Buches kommt man dann sehr gut mit der direkten Hilfe zu wx und den wx Beispielen klar.
Die Beispiele im Buch sind sehr ausführlich erklärt und bauen teilweise aufeinander auf, so daß man sich nicht ständig neu orientieren muß. Sehr praxisbezogen und funktional.
Das Buch liefert auch Hinweise und Beispiele zu einem 'guten Programmier Stil': z.B. Refactoring
Im Ganzen ist dieses Buch das Beste, was einem passieren kann, wenn man mit dieser Sprache sinnvoll GUI programmieren will. Volle Empfehlung.
Die hilfreichsten Kundenrezensionen auf Amazon.com (beta)
Like other volumes in Manning's In Action series, wxPython presents a comfortable combination of introduction, overview, and example that encourages exploration and experimentation. The text is clear and concise, offering a no-nonsense explanation of the most relevant portions of the wxPython libraries and the best practices for their use, delivered at a measured pace that never manages to overwhelm, and uncannily launches into explanations of your questions just as they arise. Numerous reference tables provide a handy guide to the details (object properties, method signatures, events, etc.) that you'll be coming back to in your own future development. The expanded table of contents, listing each of the "how do I..." subsections of each chapter, is also a nice feature that will help make this a valuable reference. Code examples are functional, clean, and on-topic, just the right size to illustrate the concept at hand, and nearly always accompanied by illustrations of the resulting behavior. All the code is available online, and it's worth your time to either download it and give it a spin, or key it yourself and see how it behaves on your OS of choice. An especially nice feature of the example code in the book is that it's well annotated, either with a brief note or a bulleted number that will be referenced in an in-depth explanation immediately following the code listing; this helps the reader quickly zero in on the essential elements of the example, and it's surprising that such a useful technique is not more frequently encountered in programming books. A few errors seem to have snuck through the editing process, though, so deeply involved readers will want the errata nearby when monkeying with example code. Manning's "Author Online" forums are also a great resource if you get stumped along the way.
The book is divided into three major sections, each six chapters long. The first, "Introduction to wxPython," is primarily a tutorial that walks the reader through the foundations of coding in wxPython-land. Newcomers to GUI programming might find certain portions a bit dense and mildly daunting--specifically chapters 2 and 3--but patience here will be rewarded with a good understanding of critically important concepts, such as wxPython's event handling model, that will be leveraged over and over again throughout the rest of the book. Chapter 4 introduces PyCrust and other tools from Patrick O'Brien's Py library that you can use for interactive debugging or even reuse within your own wxPython applications. Chapter 5 is a real gem, providing an excellent discussion and practical walkthrough of the refactoring process, an exploration of the benefits of the Model-View-Controller pattern and how to do MVC in wxPython, and illustrates how to unit test your wxPython app; these are non-glamourous topics that help aspiring developers grow into good professionals, and this is a perfect place to see these topics. Chapter 6 presents the construction of a simple but fairly polished toy sketch application, a satisfying achievement that nicely rounds out the introductory section.
The second section, "Essential wxPython," begins the more reference-oriented material, covering (unsurprisingly) the essential widgets of the wxPython toolkit: text labels, text entry, buttons, checkboxes, and the like in Chapter 7; frames (what most of us think of when they think of "windows") in Chapter 8; dialogs in Chapter 9; various flavors of menus in Chapter 10; the ins and outs of sizers in Chapter 11; and basic graphics manipulation (putting images on the screen, customizing the cursor, etc.) in Chapter 12. Each subsection builds logically on the one that came before it, and likewise each chapter follows from its predecessor, introducing new widgets just as you're ready for them. The text here is significantly lighter than in the first few chapters, so this reads fairly quickly.
The third section, "Advanced wxPython," covers some more complicated widgets and topics that probably won't be day-to-day concerns but which are important enough that, when you need to know about them, they're covered in the book: list controls (think Windows Explorer or Macintosh Finder) in Chapter 13; grid controls (think spreadsheet applications) in Chapter 14; the tree control (think file system trees, or registry editors) in Chapter 15; HTML widgets (a great idea for a help facility in your applications) in Chapter 16; the wxPython printing framework in Chapter 17. Finally, Chapter 18 rounds things out with a grab-bag of other topics that didn't merit their own chapters but which are good to know about anyway: using the clipboard, managing drag and drop operations, timers, and threading issues.
To be fair, there are a few imperfections here, but they mostly amount to personal nit-picking. While it's probably not essential, there's no discussion of sound or other multimedia functionality; and from a structural standpoint, the book would have benefitted from a brief afterword to launch the reader into further reading or development activity. Finally, and this might be slightly unfair as I'd just finished reading one of O'Reilly's Head First books when I picked up wxPython in Action, this book could probably use a little more personality; when the occasional editorial comment sneaks through, it's a welcome break from the readable but positively arid expanses of text and examples.
That said, there's obviously still a lot here to love. wxPython is clearly the way to build cross-platform GUI apps in Python; even Guido van Rossum, Python's creator and benevolent dictator, advocates it, saying, "wxPython is the best and most mature cross-platform GUI toolkit... the only reason wxPython isn't the standard Python GUI toolkit is that Tkinter was there first." wxPython in Action is clearly the authoritative resource on the subject, a great introduction that will also serve as an excellent reference for years to come. Recommended for wxPython n00bs and gurus alike.
Because of the 5-Star reviews for this book here on Amazon I purchased it and after having it 1 week I will add my 5-Star rating. This book is fantastic.
The writing is straightforward, the examples are clear, everything is explained concisely but comprehensively. I started at the first chapter and was very pleased that it started immediately with several simple GUI examples called bare.py and spare.py, for example.
Far too many programming books spend 1/3 of the book doing a basic tutorial of the language before you get to anything useful. Not this book. It states you should be somewhat familiar with Python and recommends another book if you need to learn it. So if you are beyond the basics and worried about getting another dumbed-down textbook, you can stop worrying; This book is ALL useful content.
I am immensely pleased with this book. Internet tutorials are useful for many things, so do not imagine I consider them useless for learning. But this book is superior and it is worth every penny.
The book boasts numerous tables that list most commonly used methods or classes for each topic, but the list is not exhaustive. Coupled with the rapidly changing API, the lists are nearly useless. There are also no screenshots with the various widgets all shown for comparison purposes or just to figure out which one you want.
Sections are constructed around questions, such as "How can I use file picker?", or "What color names are predefined?" Which is fine usually, except sometimes, the authors merely cover a very specific question instead of properly introducing a new widget and its functionality.
There are numerous other examples of where the book falls short. Sizers, similar to Swing's LayoutManagers, get a very brief treatment, focusing mostly on the, in my opinion, rather useless GridSizer. Compare this with the Swing Tutorial's in-depth treatment of each individual LayoutManager.
Want to know how to handle mouse events like the scroll wheel? Tough luck, because there's absolutely nothing in the book about it. Instead, the book gives you the basics of event handling and probably expects you to look up the details of scroll wheel handling in the API docs online (which do not have example code).
Overall, this book may be fine for getting you started on a basic application, say, a GUI front-end to a database. Anything more advanced and you had better be ready to get down and dirty with the online API docs.
This book contains lots of great samples of what you can do with wxPython. Great. If your problem looks like the sample, you can use the sample code.
If you want to go beyond the sample code, you are handicapped in two ways:
1) When flags, events, methods, etc. are discussed, the discussion introduces only the most often used. The tables which discuss the resources available to you start off incomplete.
2) The index is not strong. I count 544 pages covered by 1200 index entry lines. By contrast, the wxWidgets book is 662 pages, covered by 3240 index entry lines. When I need to look something up, I often find that neither book has an index entry for what I am looking for.
In contrast, Python Essential Reference by Beazley invariably has an entry for what I want to know. I hardly ever turn to the electronic documentation for Python itself as Beazley answers my Python questions in a single reference.
With wxPython and wxWidgets, I often need to turn to the electronic documentation because these two books need supplementation to serve as references.
The format is quite pleasing. For the sections on the various widgets, there is usually a short intro, a few code examples, a table that shows the main API methods for the widget which is more useful than the online docs, and quite a few screenshots throughout. The code itself is usually short, to the point, and at most a page long, so it doesn't try to show 10 things at the same time and it's easy to copy-paste (if you have the ebook version, also available) into your own programs. As the previous reader said, it's easy to see that this was written by one of the authors of wxPython. Despite being written by an expert, it didn't skim over some of the seemingly obvious but confusing for a beginner things in the package. For example, the book will tell you how to redirect "print" output to the console instead of a separate window (answer: use App(false) when instantiating your app), what's the difference between a Frame (window) and a Panel anyway (answer: panel allows tabbing), why you don't need a panel when using a dialog (answer: tabbing is already built in), why there's no 'pack' or 'appendToDisplayList' anywhere (answer: the first argument in a widget gives the parent and the framework automatically adds it to the display list), and a whole bunch of other little things.
There was one thing I thought was missing however, and that is a chapter on maintaining portability across platforms (especially with regards to sizing). Apart from that, the book is flawless, highly recommended!