Monday, December 5, 2011

py2exe, Windows 7 & Vista

I don't use py2exe very often, but it can be a useful tool for environments that may not have an existing Python installation.

I recently used py2exe on my Windows 7 PC to build a small tasktray tool. The resulting executable ran fine on my PC (doesn't it always?), but threw an exception on any Vista PC it was run on.

File "win32com\__init__.pyo", line 5, in File "win32api.pyo", line 12, in 
File "win32api.pyo", line 10, in __load
ImportError: DLL load failed: The specified module could not be found.
After more online searching than I'd like to admit, I found a post that said py2exe may be including W7-specific DLLs, when instead it should be leaving those out, forcing Vista to go find its native builds of those DLLs.

I was able to fix the problem by adding two DLLs to the "dll_excludes" list in my py2exe setup script:
options = {
   "bundle_files": 3,
   "compressed": 1,
   "optimize": 1,
   "excludes": excludes,
   "packages": packages,
   'dll_excludes': [ 'mswsock.dll', 'powrprof.dll' ]
The tool now runs on both Vista and Windows 7.

Sunday, February 27, 2011

GDC 2011 Wrap-up, download

The Technical Artist Boot Camp went really well today. I personally learned a great deal from both the attendees and fellow presenters. Thanks to everyone that turned out, and thanks for all the great questions!

Here is the sample script file I promised in my talk on databases. It's a simple, working illustration of how to use SQLAlchemy ORM to map a Python class to a database table. Please let me know if you have any questions. (2 KB)

Sunday, February 20, 2011

GDC 2011 - Technical Artist Boot Camp

Game Developers Conference 2011 is a week away. I'm co-presenting at the Technical Artist Boot Camp, a special all-day Tutorial session on Tuesday March 1.

My portion of the Boot Camp is called "Embrace the Database." Here's my summary:

They may have a mystical aura about them, but databases are far easier to use than you may think. They can be a Technical Artist’s greatest ally in game development, powering your most important tools, gathering usage and error data you’ve never had access to, enabling new workflows and revealing hidden weaknesses (and strengths) in your content pipelines.

This session will also explore how to use Python to unlock the power of databases at your studio. We will look at what databases do best, using practical examples to get you started. We'll discover how Object-Relational Mapping lets you interact with a database in a simple manner that any Python user will already understand

I'm really excited to be presenting alongside so many talented TAs from our industry. It's going to be packed with great ideas and techniques. If you plan to be in SF for GDC, definitely stop by for our session.