Using Python to automate builds

Tim Arnold tim.arnold at
Wed Aug 5 18:34:18 CEST 2009

"Kosta" <kosta.koeman at> wrote in message 
news:84d9ae10-3aee-40a8-97ac-05799da0de64 at
>I am a Python newbie, tasked with automating (researching) building
> Windows drivers using the WDK build environment.  I've been looking
> into Python for this (instead of writing a bunch of batch files).
> What I would like to do, is to open a cmd window, and start a Python
> script.  This script would then (based upon input arguments), build
> different flavors of the driver (fre, chk, x86, x64) and do some post
> processing (create cat files, sign, etc.).
> I was hoping to take advantage as much as possible of exisiting
> infrastructure from the WDK.  I am able to call setenv.bat and provide
> all the input parameters.  One of the things setenv.bat does is change
> the path environment variable.  However, this is not captured by
> Python.  I could duplicate the functionality, but I'd rather not.  Is
> there a way to capture all enviroment variable changes being made by a
> batch file from Python?
> Thanks!

It sounds like you know what you're doing. I just wanted to point out that 
you can specify environment dictionaries in the subprocess.Popen module. You 
can set a different dictionary for each call you make to the system. Not 
sure if that helps,

More information about the Python-list mailing list