How do you stop the output from subprocess.Popen from being output? Printing can sometimes be slow if there is a great deal of it.
相关问题
- how to define constructor for Python's new Nam
- streaming md5sum of contents of a large remote tar
- How to get the background from multiple images by
- Evil ctypes hack in python
- Correctly parse PDF paragraphs with Python
In Python 3.3+ you could use
subprocess.DEVNULL
, to suppress the output:Remove
stderr=STDOUT
if you don't want to suppressstderr
also.If you want to totally throw it away:
If you are using Python 2.5, you will need
from __future__ import with_statement
, or just don't usewith
.