wes@wes:~/Documents/python/ch1$ cat new_pysysinfo.py
#!/usr/bin/env python
#Very short script that reuses pysysinfo_func code
from pysysinfo_func import disk_func
import subprocess
def tmp_space():
tmp_usage = "du"
tmp_arg = "-h"
path = "/tmp"
print("Space used in /tmp directory")
subprocess.call([tmp_usage,tmp_arg, path])
def main():
disk_func()
tmp_space()
if __name__=="__main__":
main()
wes@wes:~/Documents/python/ch1$ cat pysysinfo_func.py
#!/usr/bin/env python
# A System information gathering script
import subprocess
# Command1
def uname_func():
uname = "uname"
uname_arg = "-a"
print("Gathering system informaiton with %s command:n" %uname)
subprocess.call([uname, uname_arg])
# Command2
def disk_func():
diskspace = "df"
diskspace_arg =