When I connect a Paramiko client, I get output I don't need:
Connected (version 2.0, client OpenSSH_7.2p2)
Authentication (publickey) failed.
Authentication (publickey) failed.
Authentication (password) successful!
I tried to suppress the stdout as suggested in this question, but it doesn't work:
sys.stdout = open(os.devnull, "w")
print("AAAAAAAAAAAaaaaaaaaaaaaaaaaa")
my_client.connect(hostname=hostname, username=username, password=password)
sys.stdout = sys.__stdout__
The "AAAAAAAAAAAaaaaaaaaaaaaaaaaa" does NOT appear, but the output from Paramiko still does. How do I stop Paramiko's info from printing to the console?