Question

I have the following post-build step in a VC++ 2005 project that calls a Python 2.5.1 script:

postbuild.py

postbuild.py does:

import os
os.system('cd') # cd is just a test, could be anything

The process never starts, and it's the same with any other process I try, even using subprocess.call or Popen instead of os.system.

Does anyone know about anything related to problems like this in Python 2.5.1 or in build events in Visual C++ 2005 SP1?

Was it helpful?

Solution

Solved. For some reason, using "postbuild.py" as postbuild step inhibits the python script from spawning other processes, where "python.exe postbuild.py" has no problems, and neither "pythonw.exe postbuild.py". I'm not sure why this happens, as all three methods are valid when used from cmd.exe.

But I would like to know if anyone has an explanation for this.

OTHER TIPS

Be aware that the post build event will only run immediately after a completed build. If the project had already been built (and so does not need building again), then the post build step will not run at all.

If you're editing the python script and then trying to get it to run by building the project, then it's not going to do anything unless you edit a file within the project each time, to force the build to occur.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top