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.

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...

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.