O'Reilly logo

Python Programming On Win32 by Mark Hammond, Andy Robinson

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

PythonWin

As mentioned in Chapter 4, PythonWin is a framework that exposes much of the Microsoft Foundation Classes (MFC) to Python. MFC is a C++ framework that provides an object-based model of the Windows GUI API, as well as a number of services useful to applications.

The term PythonWin is a bit of a misnomer. PythonWin is really an application written to make use of the extensions that expose MFC to Python. This means PythonWin actually consists of two components:

  • Python modules that provide the raw MFC functionality

  • Python code that uses these modules to provide the PythonWin application

We focus primarily on the MFC functionality exposed to Python so we can build a fully functional GUI application.

As PythonWin mirrors MFC, it’s important to understand key MFC concepts to understand how PythonWin hangs together. Although we don’t have room for a complete analysis of MFC, an introduction to its concepts is in order.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required