Hi
I am on windows machine. I am calling two python scripts from PHP code using POPEN function.
$p1 = popen($Python_script1, 'r');
$p2 = popen($Python_script2, 'r');
Python_script1 creates new text file and writes some data into it. this text file is later accessed by Python_script2.
Python_script1 runs fine. But Python_script2 does not run at all.
Is there any way in PHP by which I can wait for 1st process to complete and file is created successfully and then run 2nd process?
SLEEP function is of no use as time taken to finish 1st process is unknown.
Regards,
Pratik
PHP popen function : How to wait for process completions?
Moderator: General Moderators
-
pratikpotnis
- Forum Newbie
- Posts: 4
- Joined: Mon Nov 23, 2009 5:50 am
-
pratikpotnis
- Forum Newbie
- Posts: 4
- Joined: Mon Nov 23, 2009 5:50 am
Re: PHP popen function : How to wait for process completions?
I am eagerly waiting for the reply.
Re: PHP popen function : How to wait for process completions?
I'm not sure of a way to do this.
Can you not combine the two python scripts into one? Or maybe call the second script from the first. That way it wouldn't matter. You only need to call one script.
Can you not combine the two python scripts into one? Or maybe call the second script from the first. That way it wouldn't matter. You only need to call one script.