0

I have a series of code like below.In test.Bat file contains code,it will terminate after its code completion. Everything is working fine,But When i try to run a python script-it prints finished when the batch file was running

from subprocess import Popen
print "start"
Popen("C:\Users\test.Bat")
print "Finished"

I want to print "Finished" after exceution completion of batch file..How can i achieve that

pavithran G
  • 112
  • 2
  • 13
  • Have a look https://stackoverflow.com/questions/2837214/python-popen-command-wait-until-the-command-is-finished – ZeusNet May 31 '17 at 08:57
  • @ZeusNet ,'p = subprocess.Popen(([data["om_points"], ">", diz['d']+"/points.xml"])' What does it mean.How can i achieve from that to this – pavithran G May 31 '17 at 09:33
  • `import subprocess as sub print "start" sub.POpen("C:\\Users\test.bat") \n sub.communicate() print "finished"` should be the solution for your example – ZeusNet May 31 '17 at 11:21
  • thanks,now its working – pavithran G May 31 '17 at 11:23

0 Answers0