A lightweight Python script that gathers and displays comprehensive system information in a tabular format. This cross-platform tool provides essential hardware and software details about your computer without requiring external dependencies.
- Operating System Information: OS name, version, build number, and installation date
- CPU Details: Both physical and logical core counts
- Memory Information: Total and available RAM
- System Uptime
- GPU Detection: Identifies graphics cards across different vendors
- Save system information to a timestamped text file
- Cross-Platform Support: Works on Windows and Linux
- Python 3.8 or higher
psutillibrary for enhanced CPU detection accuracy
- Clone this repo:
git clone https://github.com/augustwise/sysinfo-py.git
cd sysinfo-py- Install
psutilfor better CPU core detection:
pip install psutilRun the script directly:
python script.pyThe script will first ask if you want to export the system information to a text file:
Do you want to export the system information to a text file? (y/n):
- Enter
yoryesto save the information to a timestamped file (e.g.,pc_info_20250819_0930.txt) - Enter
nornoto only display the information in the terminal
The exported file includes a header with generation timestamp and the complete system information table.
The script will first prompt for export preference, then display:
Do you want to export the system information to a text file? (y/n): y
Gathering system information...
+------------------+---------------------------------------------+
| Property | Value |
+-================-+-===========================================-+
| Operating system | Windows 11 Professional (build 26100.4652) |
| OS install date | 2025-04-30 12:51:27 FLE Daylight Time |
| System uptime | 3 days, 12 hours, 7 minutes, 41 seconds |
| Physical cores | 4 |
| Logical cores | 8 |
| GPU(s) | AMD RadeonT RX 640, AMD Radeon(TM) Graphics |
| Total RAM | 15.35 GB |
| Free RAM | 8504.98 MB |
+------------------+---------------------------------------------+
System information exported to: C:\Projects\sysinfo-py\pc_info_20250819_0930.txt
- OS version and build detection via Windows Registry
- Install date from Registry
- CPU core count via PowerShell and WMI
- Memory information via Windows API
- GPU detection via PowerShell and WMIC
- OS information from
/etc/os-release - Install date estimation from system directories
- CPU core count from
/proc/cpuinfoandsysfs - Memory information from
/proc/meminfo - GPU detection via lspci, NVIDIA drivers, and DRM subsystem
The application may experience slower execution times on weaker Windows PCs due to its reliance on PowerShell and Windows Management Instrumentation (WMI) for hardware detection:
- Each PowerShell command requires spawning a new process, which can take several seconds on slower machines
- CIM/WMI Query Performance
- Multiple System Calls: Hardware detection involves multiple subprocess calls with 5-second timeouts each, potentially causing delays
Linux
- Linux systems are generally faster as they use efficient
/procand/sysfilesystem reads instead of WMI