def psutil_phymem_usage():
 import psutil
 try:
  percent = psutil.virtual_memory().percent
 except:
  percent = psutil.phymem_usage().percent
 return percent

def psutil_phymem_usage ( ) : import psutil try : percent = psutil . virtual_memory ( ) . percent except : percent = psutil . phymem_usage ( ) . percent return percent
return physical memory usage requires the cross-platform psutil library .