Hackerss.com

Hackerss.com is a community of amazing hackers

Hackerss is a community for developers, data scientitst, ethical hackers, hardware enthusiasts or any person that want to learn / share their knowledge of any aspect of digital technology.

Create account Log in
hackerss
hackerss

Posted on

Print available ram memory in Python

Print available ram memory - Python:


import psutil

def available_ram():
    """
    Print available ram memory.

    Returns
    -------
    int
        The available ram memory.
    """

    #return the available ram memory
    return psutil.virtual_memory().available

#example
result = available_ram()
#output
print(result)  #23


Enter fullscreen mode Exit fullscreen mode

Top comments (0)