sysinfo.py 882 B

123456789101112131415161718192021222324
  1. #Sysinfo.py - Get info about computer and OS
  2. #This code has only been tested on Ubuntu 20.04 LTS and may not work on any other distros of Linux.
  3. #Import all required libraries/modules
  4. import subprocess as sp
  5. import platform
  6. import os
  7. #Ask user if they have the Linux command line tool figlet installed
  8. figlet_install = input("Do you have figlet installed on your linux terminal (Y/N)? ")
  9. #If they already have it installed, move on to the next part in the code
  10. if figlet_install.upper() == "Y":
  11. pass
  12. #If user does not have figlet installed, in the background the program runs the Linux command for installing figlet.
  13. if figlet_install.upper() == "N":
  14. os.system("sudo apt-get install figlet")
  15. #Run figlet and get the name of the user's computer
  16. os.system("figlet %s" %(platform.node()))
  17. #Execute bash script sysinfo.sh
  18. sp.call("sysinfo.sh")