title: Python gives broken pipe error and unable to write error while using os module
body: <pre><code>import os 
  cmd='for file in /proc/*/status ; do awk \'/VmSwap/||/^Pid/||/Name/{printf "%-20s", $2 $3}END{ print""}\' $file; done | sort -nr -k 3  | head -5'
  os.system(cmd)
  </code></pre>
  
  <h1>output, i have added # , my question is , why am i getting broken pipe error , last two lines.</h1>
  
  <h1>>>> res = os.system(cmd)</h1>
  
  <h1>sort: write failed: standard output: Broken pipe</h1>
  
  <h1>sort: write error</h1>