00001 import subprocess as sb 00002 import os 00003 00004 class CmdProcess: 00005 00006 def __init__(self, cmd_list): 00007 self.cmd_list= cmd_list 00008 self.process = None 00009 00010 def run(self): 00011 self.process = sb.Popen(self.cmd_list) 00012 00013 def kill(self): 00014 os.system('kill -2 %d' % self.process.pid)