[python-win32] Regarding build of code using Visual Studio in python

Tim Roberts timr at probo.com
Tue Jun 16 19:05:03 CEST 2009


a h wrote:
>
> I have a C source code, i want to build it using Visual Studio without
> using its IDE. Actually i want to know that how do i write code/script
> in python so that it builds my "source.c" file and provides me
> "source.obj" and "source.exe" files.

As long as you have the environment variables set up properly (by
calling vcvarsall.bat or vcvars32.bat, depending on the version), it's
just a matter of calling the command line compiler using subprocess or
os.system:
    cl source.c

-- 
Tim Roberts, timr at probo.com
Providenza & Boekelheide, Inc.



More information about the python-win32 mailing list