def _create(self, process): self.__process = subprocess.Popen(process, stdin=subprocess.PIPE, stdout=subprocess.PIPE, close_fds=True) self.__stdin = self.__process.stdin self.__stdout = self.__process.stdout def _listen2(self): x = True while x: (rr, wr, er) = select.select([self.__stdout], [], []) for contents in rr: print contents.readlines() x = False