Skip to content

Instantly share code, notes, and snippets.

@JordanReiter
JordanReiter / subprocess_timeout.py
Created April 18, 2012 18:40 — forked from kirpit/bash.py
Enables to run subprocess commands in a different thread with TIMEOUT option!
import subprocess, threading
class Command(object):
'''
Enables to run subprocess commands in a different thread
with TIMEOUT option!
Based on jcollado's solution:
http://stackoverflow.com/questions/1191374/subprocess-with-timeout/4825933#4825933
'''