Efrat Regev wrote:

> 1. The script is not in the directory of the makefile, and changing the 
> locations of either is not an option. Consequently, the makefile fails, 
> since it can't find the targets/dependencies.

build_dir = "path/to/makefile"

cwd = os.getcwd() # get current directory
try:
     os.chdir(build_dir)
     os.system("make")
finally:
     os.chdir(cwd)

> 2. After searching around, it seems that os.system(..) should be avoided 
>   if there's an alternative.   Is there one in this case?

"make" is not an operating system service, no.

</F>

-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to