How to hide output of subprocess

For python >= 3.3, Redirect the output to DEVNULL: import os import subprocess retcode = subprocess.call([‘echo’, ‘foo’], stdout=subprocess.DEVNULL, stderr=subprocess.STDOUT) For python <3.3, including 2.7 use: FNULL = open(os.devnull, ‘w’) retcode = subprocess.call([‘echo’, ‘foo’], stdout=FNULL, stderr=subprocess.STDOUT) It is effectively the same as running this shell command: retcode = os.system(“echo ‘foo’ &> /dev/null”)

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)