Month: January 2015

Some Python “Best Practices”

Python Logo As I have said before, I don’t believe their are truly “best practices”, sometimes there are “best known practices”, or “best known practices for a given context”.    But, there are often times when it is clear something is a bad practice.  And through the school of hard knocks, I’ve learned from attempting some practices that I thought were good, but turned out to be bad.  So here is what I have learned.

Read More →

Python Script to Automate Refreshing an Excel Spreadsheet

Excel Logo Plus Python LogoOften I run into situations where it makes sense to do analysis of a lot of database data in an Excel spreadsheet, but due to the amount of processing the spreadsheet requires when updating, it takes a long time for the spreadsheet to “Refresh All”.

One solution to this problem is to automate the spreadsheet so it refreshes every night.  The following is a small Python script that can do this using the Python for Windows Extension:

Read More →

Solution to Excel/Access/ODBC to PostgreSQL Integration Problems

In order to do more in-depth analysis of our student data, we have recently setup ODBC access to our online SIS, which is running on PostgreSQL.  My goal was to have Access connect to the PostgreSQL data source, so I could create queries (views) in access, which I could then import into Excel.  While Excel should easily connect to Access, as they are both Microsoft products, this has NOT been the case. But now that I have been able to figure out how to get it to work, I’m posting the solution for anyone else who might run there head into the same brick wall.

Read More →