¡@

Home 

python Programming Glossary: number_of_lines

Stop reading process output in Python without hang?

http://stackoverflow.com/questions/4417962/stop-reading-process-output-in-python-without-hang

top stdout subprocess.PIPE close_fds True try # save last `number_of_lines` lines of the process output number_of_lines 200 q collections.deque.. # save last `number_of_lines` lines of the process output number_of_lines 200 q collections.deque maxlen number_of_lines # atomic .append.. output number_of_lines 200 q collections.deque maxlen number_of_lines # atomic .append t threading.Thread target read_output args..