Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/python
- #system Information Gathering
- import subprocess
- print ( "If you want system information enter 'sys' ")
- print ( "Else if you want diskspace information enter 'space' ")
- print ( "If you want all info enter 'showall' ")
- a = raw_input("enter the function command :")
- a = str(a)
- #function 1
- def sys():
- uname = "uname"
- uname_arg = "-a"
- print "Gathering system information with %s command:\n" % uname
- subprocess.call([uname, uname_arg])
- #function 2
- def space():
- diskspace = "df"
- diskspace_arg = "-h"
- print "Gathering diskspace information with %s command:\n" % diskspace
- subprocess.call([diskspace, diskspace_arg])
- #function 3
- def showall():
- sys()
- print " "
- space()
- if a == "sys":
- def main():
- sys()
- elif a == "space":
- def main():
- space()
- elif a == "showall":
- def main():
- showall()
- main()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement