I am currently writing a python script that will automate make files that are there in various directories under my project. The directory structure is like this :
Repository
|
|
_____ |_____
| |
Builds src
| |
__|__ __|__
Scripts xyz abc 3rdpartytools
| |
conf boost
| |
script1.py b2
script1.py is my python file and all the make files that I want to execute are present under the 3rdpartytools directory. boost directory is just an example. Now, I want to execute file b2
. From the shell, ./b2 works.
I tried using subprocess.call from the python file. I tried
call(["cd"," ../../../src/3rdpartytools/boost;./b2"])
but i get /usr/bin/cd: line 2: cd: ../../../src/3rdpartytools/boost/b2: No such file or directory
The same command when I execute from shell, works fine.
Python 2.7 and CentOS.