Created
December 7, 2015 03:27
-
-
Save comfuture/6914f40c920cad25fdd7 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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