Run system command with no output
Question: I'm running a `wget` in Python via `os.system`.

Is there anyways to hide the output? I tried

    
    
    > /dev/null 
    

and tried running the command with a `$` in front of it.


Answer: Use the [subprocess](https://docs.python.org/2/library/subprocess.html) module
instead.

Using `subprocess.call` (which is a helper function for some more advanced
subprocess features), you can redirect stdout and stderr to file objects. If
you open `/dev/null` (the os module has `os.devnull` which is a platform-
independant path of the null device that can help), you can hand it to
subprocess.call and suppress all output

    
    
    import os
    import subprocess
    
    devnull = open(os.devnull, 'w')
    subprocess.call([...], stdout=devnull, stderr=devnull)
    

