def __init__(self):
self.queue = Queue()
PIPE = subprocess.PIPE
self.p = subprocess.Popen(self.cmd, stdout=PIPE)
flags = fcntl.fcntl(self.p.stdout.fileno(), fcntl.F_GETFL)
fcntl.fcntl(self.p.stdout.fileno(), fcntl.F_SETFL, (flags | os.O_NDELAY | os.O_NONBLOCK))
self.out = self.p.stdout
threading.Thread(target=self.sendData).start()
评论列表
文章目录