pythonpowershellsystem-information

A way to get The total number of Memory slots on a motherboard


I am Writing a script to get system information and I got just about everything the only thing I need is a way to get the amount of Memory slots a pc has for things like memory upgrades. Most of the computers run windows 7

I can get do it powershell using:

$MEM = Get-WmiObject -ClassName Win32_PhysicalMemoryArray

Anyone know of a way to get the same result in Python?


Solution

  • Use subprocess library.

    import subprocess
    subprocess.run(["ls", "-l"])