Created
March 1, 2016 00:00
-
-
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
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
In a terminal try: | |
> python fork.py |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
while 1: | |
print "Hello" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment