Follow Slashdot blog updates by subscribing to our blog RSS feed


Forgot your password?
Perl Books Media Programming Book Reviews

Python Programming On Win32

Python is an object-oriented scripting language, similiar in ideas (if not in style) to Perl. It's getting more and more popular, as people discover the benefits brought by its simple style. It's a natural under Windows, thanks to good object-orientation. Like many free software projects, though, the Windows port of Python has suffered from poor documentation. Until now, that is. [Updated 15:00GMT by timothy -- fixed link to tutorial.](Read more.)

Python Programming On Win32
author Mark Hammond & Andy Robinson
pages 652
publisher O'Reilly, 01/2000
rating 8.5
reviewer chromatic
ISBN 1-56592-621-8
summary A great introduction both to programming Python under Windowsand to COM programming for non-Windows programmers.


What's Good?

Python has made programming under Win32 really, really easy. Not that it didn't need to be easy before -- it's just that nobody knew how it worked. This book knocks that for six. It covers a basic introduction to Python, builds a slightly more advanced tutorial on that and then covers a load of other topics to finish off. The really big secret is that the information inside isn't just for Windows, though. Quite a lot of it is applicable elsewhere. Topics like printing output to PDF files, using POP3 and HTTP in python would be a useful addition to anybody using Python who isn't already aware of these things. If you've just started learning Python, there will be tons of ideas for you to experiment with.

But the big thrust of the book is COM (or OLE, or ActiveX or whatever it's called this week). The book slides you gently in, explaining the ideas behind OO programming that you need to know to take advantage of it, before presenting simple demos of what COM can do and how it was achieved. Then it takes you on to bigger and better things, and specifically to an accounting system that was developed using Python/Win32. Please ignore the word "accounting" in the previous sentence! It's just an application that the book uses to demonstrate Python and COM working together and ways of using it (e.g. shoveling data straight into Excel from the aforementioned accounting system).

The remaining part of the book has plenty to sink your teeth into, from Internet to serial communication, along with little things that you'll soon begin to appreciate as essential, like user management using Python. If you suddenly want to change all of your users somehow, you'll be grateful that you can do it programmatically.

The book brims with practical ideas that focus on one programming paradigm that a lot of people seem to forget about: Getting Things Done. Also, it was written by the author of the code, and it shows.

In short, this book brings the Windows world the kind of programmability that Unix people have come to expect. And the kind that Unix people can expect to see, too; from what I've seen of Bonobo, it's rather similiar to COM.

What's Bad?

No book is without its flaws, and this one has a couple. My biggest bugbear would be with the Python tutorial section: At 8 pages, it's just not long enough for someone who isn't accustomed to Python. While the online Python tutorial is reasonable, I would have expected a better introduction, given that Python isn't as well known as it could be. That could put some people off the book.

My other complaint is that the book is too small. Well, no -- it's just right actually, and has the nice bendy RepKover thing. But the book is burdened with so many topics that at times some subjects feel like they could have used a bit more in-depth treatment, or more extended examples. The authors must have felt the same way, since at the end of most chapters, there are pointers to further information, which is actually pretty useful.


I'm sure that there are a lot of Slashdot readers who run Windows on a regular basis. I think that this book will help a lot of them understand their environment better and help them tame it. It's also useful for die-hard Unix-heads like me, who are suddenly faced with a need to get things done under Windows and would like a clearer explanation of what they are up against, as well as some interesting ideas for when they return. Lastly, it's definitely useful to anybody already using the Python Win32 extensions, because the documentation that comes with those extensions cannot compare to this lovely, practical book.

Table Of Contents

  1. Introduction to Python

    1. What is Python?
    2. Python Language Review
    3. Python on Windows
    4. Integrated Development Environments for Python
    5. Introduction to COM

  2. Building an Advanced Python Application

    1. A Financial Modeling Toolkit in Python
    2. Building a GUI with COM
    3. Adding a Macro Language
    4. Integration with Excel
    5. Printed Output
    6. Distributing Our Application

  3. Python on Windows Cookbook

    1. Advanced Python and COM
    2. Databases
    3. Working with Email
    4. Using the Basic Internet Protocols
    5. Windows NT Administration
    6. Processes and Files
    7. Windows NT Services
    8. Communications
    9. GUI Development
    10. Active Scripting
    11. Extending and Embedding with Visual C++ and Delphi

  4. Appendixes

    1. Key Python Modules and Functions
    2. Win32 Extensions Reference
    3. The Python Database API Version 2.0
    4. Threads

This discussion has been archived. No new comments can be posted.

Python Programming On Win32

Comments Filter:

I judge a religion as being good or bad based on whether its adherents become better people as a result of practicing it. - Joe Mullally, computer salesman