Skip to content

Instantly share code, notes, and snippets.

@vaibhavb
Created March 1, 2016 00:00
Show Gist options
  • Save vaibhavb/3debc6ee07ae80ec2fa8 to your computer and use it in GitHub Desktop.
Save vaibhavb/3debc6ee07ae80ec2fa8 to your computer and use it in GitHub Desktop.
An example to show python 3.2 subprocess module working on Python 2.7 with the timeout parameter
In a terminal try:
> python fork.py
import subprocess32 as subprocess
print "Using subprocess module backported to 2.7 - https://pypi.python.org/pypi/subprocess32/"
subprocess.call("python RunTool.py", shell=True, timeout=10)
import os
while 1:
print "Hello"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment