Get Total Amount of RAM in System using Python

psutil library

  1. Install psutil library from the command line:
pip install psutil
  1. Get total amount of RAM in system:
from psutil import virtual_memory

mem = virtual_memory()
totalMem = mem.total

print(totalMem)

Leave a Comment

Cancel reply

Your email address will not be published.