Python Forum
Use subprocess.Popen and time.sleep
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Use subprocess.Popen and time.sleep
#1
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
Reply
#2
How do you know the process has "fully opened"? I don't know what it means to be "fully opened".
Reply
#3
Hi,

Post some of your code and the error messages you are getting, so we can try tu understand better how to help you.
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
Question [subprocess] Simple way to handle error in Popen()? Winfried 1 1,174 Oct-14-2025, 09:22 AM
Last Post: snippsat
  Is there a difference between Python’s time.sleep and win32api.Sleep? phpjunkie 4 2,148 Sep-21-2024, 05:17 PM
Last Post: aakritiintelligence
  Understanding subprocess.Popen Pedroski55 6 3,549 May-12-2024, 10:46 AM
Last Post: Pedroski55
Information subprocess.Popen() suddenly giving me grief? davecotter 3 2,585 Dec-13-2023, 10:49 PM
Last Post: davecotter
  How to immediately kill and restart a thread while using a time.sleep() inside it? philipbergwerf 4 6,431 Feb-07-2022, 04:16 PM
Last Post: Gribouillis
  Subprocess.Popen() not working when reading file path from csv file herwin 13 31,100 May-07-2021, 03:26 PM
Last Post: herwin
  Did subprocess.Popen() causes main routine to pause stdout? liudr 4 6,540 May-04-2021, 08:58 PM
Last Post: liudr
  Time.sleep: stop appending item to the list if time is early quest 0 2,862 Apr-13-2021, 11:44 AM
Last Post: quest
  disable subprocess.popen prompt echo paul18fr 1 3,675 Feb-04-2021, 02:50 AM
Last Post: Larz60+
  Can you end the Time.sleep function boier96 9 21,891 Jan-16-2021, 10:09 PM
Last Post: Serafim

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020