Reputation: 23
Path = location of batch file.(c:....\a.bat)
And a.bat contain following data: START C:\Python27\python.exe "C:.....\test.py"
I have the following code:
my_process = subprocess.call(os.path.abspath(path), shell=True)
text_file = open("output.txt",r) # output.txt is batch file output
I expect the code should wait for batch file execution & output of batch file should generate output.txt. And later text_file = open("output.txt",r) should execute.
But code doesn't wait for batch file execution & sooner generate error that output.txt is not found.
Upvotes: 0
Views: 761