In Python - how to execute system command with no output -


Is there an inherent method in Python to execute system commands without displaying output? I only want to get the return value

It is important that it is a cross-platform, so redirecting output to / dev / null will not work on Windows, and on the other side I know that I can just check os.platform I can make myself a redirection, but I am hoping for an inherent solution.

  imported OS import subprocess subprances Call (["LS", "-L"], standout = open (OSDNowl, "W"), stadder = subprocess. STDOOT)  

Comments