Usually I can change stdout in Python by changing the value of sys.stdout
. However, this only seems to affect print
statements. So, is there any way I can suppress the output (to the console), of a program that is run via the os.system()
command in Python?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…