I searched a lot but couldn't find anything useful. Is this possible to get system information like;
CPU: Intel Core i7-3770K CPU @3.5Ghz
RAM: 8GB
Graphic Card: NVIDIA GeForce GTX 680
under Windows? How can I reach this output?
Edit: platform.processor()
is not giving the output that I want. So that is useless for me.
I've been wondering how to do this myself for a while now, so I dug around a bit and came up with this solution using
wmi
(which requirespywin32
). Of course, it goes without saying, this only works on Windows machines (and the question has theWindows
tag).Output example:
You can install both required packages via
pip
:To see what other variables you can access in various Win32 controller classes, take a look at this documentation:
Related answer found on SO: https://stackoverflow.com/a/11785020/295246
Update: For System RAM, you can use either
os_info.TotalVisibleMemorySize
(returns the value in kilobytes) orcomputer_info.TotalPhysicalMemory
(returns the value in bytes). If you use the latter, you can usehurry.filesize
to quickly convert it to a pretty human readable string.For example:
Which in my case outputs:
15G
You can even modify the G to whatever else you want. See this SO answer for more info: https://stackoverflow.com/a/5194348/295246