Monday, January 18, 2016

Impressed with Python

I've been impressed with Python of late.

I'm using Python on a project for a client. The work involves computations with data in Microsoft Excel spreadsheets. Processing involves, at a basic level, the extraction of data from a spreadsheet, some calculations, and then the generation of a result spreadsheet (different from the first spreadsheet).

Python has been surprisingly useful here. The libraries 'xlrd' and 'xlwt' handle the reading and writing of data in spreadsheets, allowing me to focus on the computations.

Python has helped in other ways. It runs a lot of our tests, and summarizes the test results. It also drives the tests of an old MFC Windows application.

This last item is important. We had no way to test the GUI for this program -- other than manual testing. The 'PyWinAuto' package lets us use Python to "drive" the GUI and run tests.

I am impressed with PyWinAuto. Perhaps more impressed than others; some years ago I created a library (in C++, not Python) to drive MFC GUI programs. The task was not trivial and my attempt was clunky and inadequate. Yet it was that foray into Windows API calls and Windows controls that gives me the appreciation for the effort of PyWinAuto.

Over the years, I have worked with many languages: BASIC, Pascal, Fortran, C, C++, Java, Perl, C#, and even a little COBOL. My experiences with each language vary. Some were fun, others were frustrating. Python is in the former category, as I have been able to do just about everything I wanted, and with little effort.

No comments:

Post a Comment