[ACCEPTED]-In Python - how to execute system command with no output-python
Accepted answer
import os
import subprocess
subprocess.call(["ls", "-l"], stdout=open(os.devnull, "w"), stderr=subprocess.STDOUT)
0
You can redirect output into temp file and 4 delete it afterward. But there's also a 3 method called popen that redirects output 2 directly to your program so it won't go 1 on screen.
Source:
stackoverflow.com
More Related questions
Cookie Warning
We use cookies to improve the performance of the site. By staying on our site, you agree to the terms of use of cookies.