0

Hi I am trying to run a python script which has this code snippet:

process = subprocess.Popen('./start_ws.pl')
process.wait()
os.system('make')

The perl script started changes environmental variables and
enters into new subshell.
After entering into new subshell, the commands below script

os.system('make')

goes unnoticed.They get executed only if i exit from subshell(created by pl script).
The system command 'make' is executable only in new subshell.

I tried like,

pid = os.fork()

if pid > 0:
  os.wait()
  os.system('make clean')

else:
  os.system('./start_ws.pl')

Even this doesnt work.

Kindly help me to run 'make' command in same env created by 'start_ws.pl' perl script.

2
Contributors
1
Reply
26
Views
4 Years
Discussion Span
Last Post by slate
0

After the subprocess exits, the environment is "gone".

So theoretically you have the following options:

I know, this does not solve your problem, but I have to go...

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.