title: Hiding console output produced by os.system
body: <p>I am calling this piece of code, but it produces some output in the console where I ran the python script (due to tee command):</p>
  
  <pre><code>os.system("echo 3 | sudo tee /proc/sys/vm/drop_caches")
  </code></pre>
  
  <p>This version does not produce console output but is there another way?</p>
  
  <pre><code>os.system('sudo bash -c "echo 3 &gt; /proc/sys/vm/drop_caches"')
  </code></pre>