I want to write a python program that would open an application and wait till it's closed and at last prints when it was closed. I wrote the below code but it prints the time right after it is opened.
I used os.startfile(path_to_application)
to run the file, but the online documentation says that this function doesn't have the option to wait for the application to close, and no way to retrieve the application's exit status.
Question: Is there a function that I can use to know when the application is closed?
Code:
import time, os
start = time.time()
os.startfile(path_to_application)
end = time.time()
print end - start, "seconds"