• Complain

Mike Driscoll - wxPython Recipes: A Problem - Solution Approach

Here you can read online Mike Driscoll - wxPython Recipes: A Problem - Solution Approach full text of the book (entire story) in english for free. Download pdf and epub, get meaning, cover and reviews about this ebook. year: 2017, publisher: Apress, genre: Computer. Description of the work, (preface) as well as reviews are available. Best literature library LitArk.com created for fans of good reading and offers a wide selection of genres:

Romance novel Science fiction Adventure Detective Science History Home and family Prose Art Politics Computer Non-fiction Religion Business Children Humor

Choose a favorite category and find really read worthwhile books. Enjoy immersion in the world of imagination, feel the emotions of the characters or learn something new for yourself, make an fascinating discovery.

Mike Driscoll wxPython Recipes: A Problem - Solution Approach
  • Book:
    wxPython Recipes: A Problem - Solution Approach
  • Author:
  • Publisher:
    Apress
  • Genre:
  • Year:
    2017
  • Rating:
    5 / 5
  • Favourites:
    Add to favourites
  • Your mark:
    • 100
    • 1
    • 2
    • 3
    • 4
    • 5

wxPython Recipes: A Problem - Solution Approach: summary, description and annotation

We offer to read an annotation, description, summary or preface (depends on what the author of the book "wxPython Recipes: A Problem - Solution Approach" wrote himself). If you haven't found the necessary information about the book — write in the comments, we will try to find it.

Quickly discover solutions to common problems, learn best practices, and understand everything wxPython has to offer. This book is for anyone wanting to learn more about how to use the wxPython desktop GUI toolkit. It assumes some prior knowledge of Python and a general understanding of wxPython or GUI development, and contains more than 50 recipes covering various tasks and aspects of the toolkit.

wxPython Recipes guides you step by step. The book takes you through how to create user interfaces in Python, including adding widgets, changing background images, manipulating dialogs, managing data, and much more. Examples target both Python 2.x and 3.x, and cover both wxPython 3.0 and Phoenix, offering a complete collection of ideas to improve your GUI development.

What Youll Learn

Work with UI elements such as widgets, buttons, images, boxes, and more

Handle data in files and notebooks

Implement XML and using XML resources (XRC)

Customize the behavior of panels and objects

Who This Book Is For

People who are already familiar with the Python programming language and also have a basic understanding of wxPython.

Readers who understand event loops and the basics of creating user interfaces with another Python UI toolkit, such as Tkinter or PyQt.

Mike Driscoll: author's other books


Who wrote wxPython Recipes: A Problem - Solution Approach? Find out the surname, the name of the author of the book and a list of all author's works by series.

wxPython Recipes: A Problem - Solution Approach — read online for free the complete book (whole text) full work

Below is the text of the book, divided by pages. System saving the place of the last page read, allows you to conveniently read the book "wxPython Recipes: A Problem - Solution Approach" online for free, without having to search again every time where you left off. Put a bookmark, and you can go to the page where you finished reading at any time.

Light

Font size:

Reset

Interval:

Bookmark:

Make
Mike Driscoll 2018
Mike Driscoll wxPython Recipes
1. Introduction
Mike Driscoll 1
(1)
Ankeny, New York, USA
Welcome to my wxPython recipes book! As with most cookbooks, this one is made up of a series of recipes. Some recipes will be more involved than others, but most of the time, the recipe will be a nice bite-sized chunk of information that only covers three to five pages or so. There are more than 50 recipes in this book. I have compiled them over the last eight years from people who have asked questions on the wxPython mailing list, StackOverflow, or e-mailed me directly.
Normally I would spend a lot of time in the introduction going over each section of the book, but since this book is a series of recipes, it wont actually be split into sections. Instead, the recipes will be grouped where possible. For example, I have a number of XRC-related recipes, so they will be kept together as a single chapter.
The recipes will include screenshots of the interfaces that you will be creating. There will be additional screenshots included if and when we change the code inside a recipe. A good example of this is in the Frame Styles recipe where we try out various flags that affect how wx.Frame is displayed.
Who Should Read This Book
This book is targeted at people who are already familiar with the Python programming language and also have a basic understanding of wxPython. At the very least, it would be helpful if the reader understands event loops and the basics of creating user interfaces (UIs) with another Python UI toolkit, such as Tkinter or PyQt .
About the Author
You may be wondering who I am and why I might be knowledgeable enough about Python to write about it, so I thought Id give you a little information about myself. I started programming in Python in Spring 2006 for a job. My first assignment was to port Windows log-in scripts from Kixtart to Python. My second project was to port VBA code (basically a graphical user interface, or GUI, on top of Microsoft Office products) to Python, which is how I first got started in wxPython. Ive been using Python ever since, doing a variation of back-end programming and desktop front-end UIs. Currently I am writing and maintaining an automated test framework in Python.
I realized that one way for me to remember how to do certain things in Python was to write about them and thats how my Python blog came about: www.blog.pythonlibrary.org/ . As I wrote, I would receive feedback from my readers and I ended up expanding the blog to include tips, tutorials, Python news, and Python book reviews. I work regularly with Packt Publishing as a technical reviewer, which means that I get to try to check for errors in the books before theyre published. I also have written for the Developer Zone (DZone) and i-programmer web sites as well as the Python Software Foundation. In November 2013, DZone published The Essential Core Python Cheat Sheet, which I coauthored. Finally, I have also self-published the following two books:
  • Python 101 , which came out in June 2014.
  • Python 201: Intermediate Python , which came out in September 2016
Conventions
As with most technical books, this one includes a few conventions that you need to be aware of. New topics and terminology will be in bold . You will also see some examples that look like the following:
>>> myString = "Welcome to Python!"
```
The >>> is a Python prompt symbol. You will see this in the Python interpreter and in IDLE . Other code examples will be shown in a similar manner, but without the >>> .
Requirements
You will need a working Python 2 or Python 3 installation. Most Linux and Mac machines come with Python already installed; however, they might not have Python in their path. This is rare, but if it happens there are lots of tutorials on the Internet that explain how to add Python to your path for your particular operating system. If you happen to find yourself without Python, you can download a copy from http://python.org/download/ . There are up-to-date installation instructions on the web site, so I wont include any installation instructions in this book for Python itself.
The wxPython toolkit is not included with Python. We will look at how to install it here. You will want to use the latest version of wxPython, which at the time of writing, is version 4. It also based on the Phoenix branch of wxPython instead of Classic. You dont really need to know the differences between these other than Phoenix supports Python 2 and 3 while Classic does not.
To install wxPython 4, you can just use pip:
pip install wxPython
This works great on Windows and Mac. I have noticed that on some versions of Linux, you may see an error or two about missing dependencies, such as webkit. You will need to install the listed dependency and then try installing wxPython again.
Once youre done installing wxPython , we can check to make sure it works with the following script:
import platform
import wx
class MyFrame(wx.Frame):
""""""
def __init__(self):
"""Constructor"""
wx.Frame.__init__(self, None, size=(500, 200),
title='Version Info')
panel = wx.Panel(self)
py_version = 'Python version: ' + platform.python_version()
wx_version = 'wxPython version: ' + wx.version()
os_version = 'Operating System: ' + platform.platform()
main_sizer = wx.BoxSizer(wx.VERTICAL)
size = (20, -1)
main_sizer.Add(
wx.StaticText(panel, label=py_version), 0, wx.ALL, 5)
main_sizer.Add(
wx.StaticText(panel, label=wx_version), 0, wx.ALL, 5)
main_sizer.Add(
wx.StaticText(panel, label=os_version), 0, wx.ALL, 5)
panel.SetSizer(main_sizer)
self.Show()
if __name__ == '__main__':
app = wx.App(False)
frame = MyFrame()
app.MainLoop()
This code should run without error and you will see a simple UI appear on screen.
Any additional requirements will be explained later on in the book.
Book Source Code
The books source code can be found on Github:
https://github.com/driscollis/wxPython_recipes_book_code
Reader Feedback
I welcome feedback about my writings. If youd like to let me know what you thought of the book, you can send comments to the following address:
comments@pythonlibrary.org
Errata
I try my best not to publish errors in my writings, but it happens from time to time. If you happen to see an error in this book, feel free to let me know by e-mailing me at the following:
errata@pythonlibrary.org
Now lets get started!
Mike Driscoll 2018
Mike Driscoll wxPython Recipes
2. Working with Images
Mike Driscoll 1
(1)
Ankeny, New York, USA
Recipe 2-1. How to Take a Screenshot of Your wxPython App
Problem
Have you ever thought that it would be cool to have your wxPython code take a screenshot of itself? Well, Andrea Gavana (one of wxPythons core developers) figured out a cool way to do just that and between what he told us on the wxPython mailing list and what I learned from other sources, you will soon learn how to not only take the screenshot but send it to your printer! Once its all done, youll have an application that looks like Figure .
Next page
Light

Font size:

Reset

Interval:

Bookmark:

Make

Similar books «wxPython Recipes: A Problem - Solution Approach»

Look at similar books to wxPython Recipes: A Problem - Solution Approach. We have selected literature similar in name and meaning in the hope of providing readers with more options to find new, interesting, not yet read works.


Reviews about «wxPython Recipes: A Problem - Solution Approach»

Discussion, reviews of the book wxPython Recipes: A Problem - Solution Approach and just readers' own opinions. Leave your comments, write what you think about the work, its meaning or the main characters. Specify what exactly you liked and what you didn't like, and why you think so.