Nov-30-2017, 11:47 PM
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
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