How to get Windows physical RAM using python?

Dan Bishop danb_83 at yahoo.com
Wed Jul 30 20:08:16 EDT 2003


Mark <nbdy9 at hotmail.com.nospam> wrote in message news:<bg92o2$onr$1 at news3.bu.edu>...
> OK, How to check the amount of Windows physical RAM using python?

The easiest way is to parse the output from $WINDIR/system32/mem.exe .

    memTotals = os.popen('mem | find "total"').readlines()
    conventionalMemory = int(memTotals[0].split()[0])
    extendedMemory = int(memTotals[1].split()[0])




More information about the Python-list mailing list