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
Information subprocess.Popen() suddenly giving me grief? davecotter 3 616 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 3,537 Feb-07-2022, 04:16 PM
Last Post: Gribouillis
  Subprocess.Popen() not working when reading file path from csv file herwin 13 15,048 May-07-2021, 03:26 PM
Last Post: herwin
  Did subprocess.Popen() causes main routine to pause stdout? liudr 4 3,636 May-04-2021, 08:58 PM
Last Post: liudr
  Time.sleep: stop appending item to the list if time is early quest 0 1,875 Apr-13-2021, 11:44 AM
Last Post: quest
  disable subprocess.popen prompt echo paul18fr 1 2,009 Feb-04-2021, 02:50 AM
Last Post: Larz60+
  Can you end the Time.sleep function boier96 9 9,457 Jan-16-2021, 10:09 PM
Last Post: Serafim
  how to pass the interactive string to Popen subprocess maiya 1 1,883 Sep-18-2020, 09:36 PM
Last Post: Larz60+
  How to get program output from subprocess.Popen? glestwid 1 2,369 Aug-19-2020, 05:44 AM
Last Post: buran
  time.sleep mtnwinds 4 2,860 May-21-2020, 10:12 AM
Last Post: Larz60+

Forum Jump:

User Panel Messages

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