Skip to content

Instantly share code, notes, and snippets.

@comfuture
Created December 7, 2015 03:27
Show Gist options
  • Save comfuture/6914f40c920cad25fdd7 to your computer and use it in GitHub Desktop.
Save comfuture/6914f40c920cad25fdd7 to your computer and use it in GitHub Desktop.
import subprocess
def df():
proc = subprocess.Popen(['df','/'], stdout=subprocess.PIPE)
output = proc.communicate()[0]
for line in output.split('\n')[1:]:
yield line.split()[:5]
print list(df())
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment