LukeeSucks
Kazakhstan
 
 
Squad Community Bot FTW
Scuffed Bot Co
Currently Offline
Featured Artwork Showcase
Lukee
Featured Artwork Showcase
Lukee
main.py
import os
import platform
import psutil
from datetime import datetime
from colorama import Fore

#⠀Byte Convert
def get_size(bytes, suffix="B"):
⠀⠀factor = 1024
⠀⠀for unit in ["", "K", "M", "G", "T", "P"]:
⠀⠀⠀⠀if bytes < factor:
⠀⠀⠀⠀⠀return f"{bytes:.2f}{unit}{suffix}"
⠀⠀⠀⠀ bytes /= factor

#⠀System Info
def sysInfo():
⠀⠀uname = platform.uname()
⠀⠀boot_time_timestamp = psutil.boot_time()
⠀⠀bt = datetime.fromtimestamp(boot_time_timestamp)
⠀⠀cpufreq = psutil.cpu_freq()
⠀⠀svmem = psutil.virtual_memory()
⠀⠀partitions = psutil.disk_partitions()
⠀⠀disk_io = psutil.disk_io_counters()
⠀⠀if_addrs = psutil.net_if_addrs()
⠀⠀net_io = psutil.net_io_counters()
⠀⠀print(Fore.RED + "System Information\n" + Fore.RESET)
⠀⠀print(f"System: {uname.system}")
⠀⠀print(f"Boot Time: {bt.year}/{bt.month}/{bt.day}/{bt.hour}/{bt.minute}/{bt.second}/")
⠀⠀print(f"Node: {uname.node}")
⠀⠀print(f"Release: {uname.release}")
⠀⠀print(f"Version: {uname.version}")
⠀⠀print(f"Machine: {uname.machine}\n")

⠀⠀print(Fore.RED + "Processor Information:" + Fore.RESET)
⠀⠀print(f"Processor: {uname.processor}")
⠀⠀print("Physical Cores: ", psutil.cpu_count(logical=False))
⠀⠀print("Total Cores: ", psutil.cpu_count(logical=True))
⠀⠀print(f"Max Frequency: {cpufreq.max:.2f}Mhz")
⠀⠀print(f"Min Frequency: {cpufreq.min:.2f}Mhz")
⠀⠀print(f"Current Frequency: {cpufreq.current:.2f}Mhz\n")
⠀⠀print(Fore.RED + "CPU Usage per core: " + Fore.RESET)
⠀⠀for i, percentage in enumerate(psutil.cpu_percent(percpu=True, interval=1)):
⠀⠀⠀⠀print(f"Core {i}: {percentage}%")
⠀⠀print(f"Total CPU Usage: {psutil.cpu_percent()}%\n")

⠀⠀print(Fore.RED + "Memory Information:" + Fore.RESET)
⠀⠀print(f"Total: {get_size(svmem.total)}")
⠀⠀print(f"Available: {get_size(svmem.available)}")
⠀⠀print(f"Used: {get_size(svmem.used)}")
⠀⠀print(f"Percentage: {svmem.percent}%\n")

⠀⠀print(Fore.RED + "Disk Information:" + Fore.RESET)
⠀⠀for partition in partitions:
⠀⠀⠀⠀print(f"=== Device: {partition.device} ===")
⠀⠀⠀⠀print(f" Mountpoint: {partition.mountpoint}")
⠀⠀⠀⠀print(f" File system type: {partition.fstype}")
⠀⠀⠀⠀try:
⠀⠀⠀⠀⠀partition_usage = psutil.disk_usage(partition.mountpoint)
⠀⠀⠀⠀except PermissionError:
⠀⠀⠀⠀⠀continue
⠀⠀⠀print(f" Total Size: {get_size(partition_usage.total)}")
⠀⠀⠀print(f" Used: {get_size(partition_usage.used)}")
⠀⠀⠀print(f" Free: {get_size(partition_usage.free)}")
⠀⠀⠀print(f" Percentage: {partition_usage.percent}%")
⠀⠀print(f"Total read: {get_size(disk_io.read_bytes)}")
⠀⠀print(f"Total write: {get_size(disk_io.write_bytes)}\n")

⠀⠀print(Fore.RED + "Network Information:" + Fore.RESET)
⠀⠀for interface_name, interface_addresses in if_addrs.items():
⠀⠀⠀⠀for address in interface_addresses:
⠀⠀⠀⠀⠀⠀print(f"=== Interface: {interface_name} ===")
⠀⠀⠀⠀⠀⠀if str(address.family) == 'AddressFamily.AF_INET':
⠀⠀⠀⠀⠀⠀⠀⠀print(f" IP Address: {address.address}")
⠀⠀⠀⠀⠀⠀⠀⠀print(f" Netmask: {address.netmask}")
⠀⠀⠀⠀⠀⠀⠀⠀print(f" Broadcast IP: {address.broadcast}")
⠀⠀⠀⠀⠀⠀elif str(address.family) == 'AddressFamily.AF_PACKET':
⠀⠀⠀⠀⠀⠀⠀⠀print(f" MAC Address: {address.address}")
⠀⠀⠀⠀⠀⠀⠀⠀print(f" Netmask: {address.netmask}")
⠀⠀⠀⠀⠀⠀⠀⠀ print(f" Broadcast MAC: {address.broadcast}")
⠀⠀print(f"Total Bytes Sent: {get_size(net_io.bytes_sent)}")
⠀⠀print(f"Total Bytes Received: {get_size(net_io.bytes_recv)}\n\n")

⠀⠀input("Press ENTER to return.")
Recent Activity
2.6 hrs on record
last played on 7 Jan
19 hrs on record
last played on 29 Sep, 2024
2.2 hrs on record
last played on 29 Jun, 2024
go6lin 5 Oct, 2024 @ 7:07am 
+Rep хорошо играет мэнчик
Moramar 2 Oct, 2024 @ 11:38am 
we can try one more game if you want
Zulkiktilar 4 Sep, 2024 @ 8:53am 
+rep plays with heart
76561199624604461 28 Aug, 2024 @ 10:29am 
siemano
dodaj do znaj prosze, mam pytanie
nwm dlaczeg nie moge dodac z maina, to Maciek
Amiri 228 12 Jul, 2024 @ 4:51am 
+rep
_/﹋\_
(҂`_´)
Rexbrand 10 Jul, 2024 @ 12:29pm 
Play today!