Use subprocess.Popen and time.sleep - Printable Version +- Python Forum (https://python-forum.io) +-- Forum: Python Coding (https://python-forum.io/forum-7.html) +--- Forum: General Coding Help (https://python-forum.io/forum-8.html) +--- Thread: Use subprocess.Popen and time.sleep (/thread-37935.html) |
Use subprocess.Popen and time.sleep - chucky831 - Aug-11-2022 Good morning everyone, I am new to Python. I am developing a script to automate a program I need at work. What I need to do via Python is simply open a program that is in the system. To do this I used subprocess.Popen() The problem is that my script should not continue until the program has fully opened. How can I go about stopping the script? I have tried using time.sleep() but using this function seems to then fail to use subprocess.terminate() to close the program. Can you help me with this? Thanks RE: Use subprocess.Popen and time.sleep - deanhystad - Aug-11-2022 How do you know the process has "fully opened"? I don't know what it means to be "fully opened". RE: Use subprocess.Popen and time.sleep - carecavoador - Aug-11-2022 Hi, Post some of your code and the error messages you are getting, so we can try tu understand better how to help you. |