1

Now I know there's psutil module for the use:

import psutil
a=psutil.virtual_memory()
print(a)

And it shows this output:

svmem(total=4238442496, available=1836089344, percent=56.7, used=2402353152, free=1836089344)

It has got percentage, but I only want percentage of RAM usage without all other features like used, free, etc. Is it possible ? Please sort this out. Thanks in advance for answers.

RMPR
  • 3,368
  • 4
  • 19
  • 31
SRP
  • 21
  • 4

1 Answers1

2

Just a minor change:

import psutil

a = psutil.virtual_memory()
print(a.percent) # Here's a change

Hope this helps :)

Devansh Soni
  • 771
  • 5
  • 16