Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import os, math, cpuinfo, sys, subprocess, webbrowser
- from psutil import virtual_memory
- windowsKey = "N/A"
- cpuBrand = "N/A"
- memTotal = "0"
- def get_windows_license():
- global windowsKey
- windows_key = subprocess.check_output(['wmic', 'path', 'softwarelicensingservice','get','OA3xOriginalProductKey'])
- windows_key = windows_key.decode().split('\r\r\n')
- windowsKey=windows_key[1]
- def get_cpu_info():
- cpu = cpuinfo.get_cpu_info()
- global cpuBrand
- cpuBrand = cpu["brand"]
- def get_mem_total():
- mem = virtual_memory()
- global memTotal
- memTotal = math.ceil(math.ceil(mem.total / 1024 / 1024) / 1024)
- if __name__ == '__main__':
- get_windows_license()
- get_cpu_info()
- get_mem_total()
- print("License: " + windowsKey)
- print("CPU: " + cpuBrand)
- print("Memory: " + str(memTotal) + " GB")
- URL='http://192.168.88.10/label/printLabel.php?customerName=Key: ' + windowsKey + "&title=" + cpuBrand + "&description=Memory:" + str(memTotal) + ' GB'
- webbrowser.open(URL)
- sys.exit(0)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement