subprocess.DEVNULL
subprocess.DEVNULL is a Python function in the Subprocess Module category. Special value that redirects output to /dev/null (suppresses output). The syntax is subprocess.DEVNULL. Returns: Special constant. A typical example: subprocess.run(["ls"], stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL). A close sibling is subprocess.run(), which runs a command and waits for it to complete. Returns a CompletedProcess instance. A close sibling is subprocess.Popen(), which executes a child program in a new process (lower-level than run()). A close sibling is Popen.communicate(), which sends data to stdin and reads from stdout/stderr until EOF. A close sibling is subprocess.call(), which runs a command and returns its return code (legacy API, use run() instead). More about this category: Subprocess management — run, Popen, call, PIPE, CalledProcessError. For a broader walkthrough, read the Subprocess Module guide. Related Subprocess Module entries: subprocess.run(), subprocess.Popen(), Popen.communicate(), subprocess.call(), subprocess.check_output(), subprocess.check_call(). This page is part of the free Python Reference documentation covering 978+ functions, methods, and modules with examples and parameter details.