Created
June 22, 2020 14:03
-
-
Save markusritschel/bc47c7fd96b063260cd4da08845f8ed1 to your computer and use it in GitHub Desktop.
Retrieve the total size of available physical memory
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from psutil import virtual_memory | |
mem = virtual_memory() | |
print(mem.total) # in bytes | |
print(mem.total / 1024**3) # in giga bytes |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment