Python Programming on Win32

Embed Size (px)

Citation preview

  • 7/28/2019 Python Programming on Win32

    1/2

    Title Python Programming on Win32Author Mark Hammond & Andy RobinsonPublisher OReillyPages 652ISBN 1-56592-621-8

    I first found this book while looking through the shelves of the local bookstore. I wasinterested, but scared by the title. Win32 evokes a nightmare of fears for me! Iimmediately purchased Learning Python by: Mark Lutz & David Ascher of OReillyinstead. After reading the Learning Python Book, I was excited to try PythonProgramming on Win32. I was relieved to find that it wasnt just a win32 API book!

    The book is divided into three logical divisions. First is an Introduction to Python.Second, we are Building an Advanced Python Application. Then last we find thePython on Windows Cookbook.

    Section#1: Introduction to PythonThe initial overview helped me understand Pythons place in the arsenal of programmingtools. I was impressed with the amount of integration into the windows environment. AnIDE was even provided to lessen the shock of a new language. I like the portability ofusing the standard modules, but the extensive list of win32 extensions means that it istruly customized for windows! Python is described as a utility language as well as ascripting language. I found the program behavior to have direct correlations to usingAutoLISP to customize AutoCAD. Along with the fluid execution of an interpretedmacro language, it is a full-functioning independent programming language that mixesthe benefits of VB and VBA in an OpenSource wrapper. It looks to me that the productdoes a lot of what Microsoft Dot NET was created to do.

    Section#2: Building an Advanced Python ApplicationOK, now I see where the heavy lifting is. Object programming pops in, as well as settingup a COM server. Each of these chapters should have complete books dedicated to theirsubjects! The authors do a good job giving simple examples, but dont claim to beTHE programming reference on the topics. I was impressed when I saw how simplyPython could tie itself in as a macro language inside your own application. It was aharder sell for me to picture using Python as a COM-client for Excel or Word, whenVBA was already built in, but the functionality was necessary to complete the COMsection. Output is also a very strong point for Python. The authors describe HTML, PDF,and Graphical output options. By the end of the second section, I was worried that Icouldnt do GUI development like my previous work on VB. The authors actually usedVB to construct a user interface for their COM serving application!

    Section#3: Python on Windows CookbookSection three quickly finished their discussion on COM and jumped into Databases. Hereis my favorite quote from the book, coming from a section heading: DAO, ADO, ODBC,OLEDB, and Other GBFLAs (Great Big Five Letter Acronyms). Python utilizes all thestandard database access options, culminating with a database API for Python. You are

  • 7/28/2019 Python Programming on Win32

    2/2

    not limited to these choices though. If you need true independence from the operatingsystem, Python offers Gadfly a relational database written entirely in Python. Moreeffort should probably be made, from a State level, to provide public data in a vendorneutral format like Gadfly. The book does an exceptional job listing authors whoproduce valuable add-ons and where they can be found.

    Im not sure that this belongs in a win32 book, but this section includes chapters onPythons functionality with SMTP, POP3, NNTP, FTP and HTTP. Looking at thesimplicity of the functionality, I can only imagine how easily one could become aspammer! I do see how I need to incorporate some of this functionality to remotelymonitor critical resources. I may be sorry if I start sending myself too many importantemails though.

    Windows NT Administration and Processes and Files were my two favorite chapters.The windows administration examples helped me understand the waste of time I havebeen spending doing repetitive tasks. I have seen that if I code simple solutions for

    repetitive tasks, the processes can be automated to reduce both workload and errors. Ihave found myself doing exactly the work that was detailed as examples! File processingwas also one of my favorites because that has been the bulk of work I have done in thepast. I find the portability of code exciting for file processing. I plan a pilot project inthe near future, utilizing python to replace the old Fortran programs that we have floatingaround the department.

    Mixed in this third and voluminous section were 16 pages of information on serialcommunications. I didnt expect to see this, but found the reading very interesting. I hadnot though about utilizing Python to control or read laboratory equipment, but here isgoes making another niche of functionality that I could use. It appears that serial andinfrared communications are treated identically, but there was no mention of USB. Ifound myself wanting to write digitizer drivers by the end of the chapter.

    Finally I found the GUI, and there are multiples of them! I am beginning to realize thatOpenSource means multiple standards. Three different examples were detailed,explaining the pros and cons of each. Tkinter was more portable, PythonWin MFC wasmore C++ and windows ish, and wxPython was an entirely different animal.

    Finally, Ill mention Active Scripting. I thought that if you bought into the M$ server,that you had to use their tools. I was unaware that you can setup your server to utilizePython in its ASP pages too. Presto! We can utilize the Gadfly database and outputHTML. Life is good and low budget.

    Reviewed by:

    Denton YoderComputer Systems EngineerBiological Systems EngineeringVirginia Tech