Forums

How can I get info about RAM? (free, used, total RAM)

Hello! I was trying to show the percentage of RAM used via this code:

print("RAM: {}%".format( round(psutil.virtual_memory().percent) ))

This code worked on my Windows PC, but on PythonAnywhere it shows next error: "FileNotFoundError: [Errno 2] No such file or directory: '/proc/meminfo'". Is there any other way to do this?

Normally it's not possible, but we have some beta features that allow users to do it. I enabled it for you.