Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
timeout value in subprocess
#2
Right, got there in the end.  Still very new to Python so getting my head around syntax and understanding the help files.

In case anyone was wondering,
strTimeoutDuration = 5 #5 seconds.  This obtained previously in my script but hard coding for this example.
strTimeout = "timeout=" + strTimeoutDuration
subprocess.run(['notepad.exe'], stdout=subprocess.PIPE, stderr=subprocess.PIPE, timeout=strTimeoutDuration)

Cheers,
J
Reply


Messages In This Thread
timeout value in subprocess - by jonesin1974 - Nov-30-2017, 08:34 PM
RE: timeout value in subprocess - by jonesin1974 - Nov-30-2017, 11:47 PM
RE: timeout value in subprocess - by snippsat - Dec-01-2017, 02:18 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  FTp timeout except korenron 2 3,730 Feb-01-2022, 06:51 AM
Last Post: korenron
  proc communicate not exiting on python subprocess timeout leoonardoo 0 3,848 Sep-13-2017, 09:54 AM
Last Post: leoonardoo
  AsyncSSH and timeout Standard_user 1 5,614 Nov-03-2016, 06:05 PM
Last Post: micseydel

Forum Jump:

User Panel Messages

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