I wrote a function to get my PC's memory. But I don't think this is the best way to get it.
def MEMORY():
mem = psutil.virtual_memory()
MEMORYlist = []
for m in mem:
if m > 100 :
MEMORYlist.append( str(round(m/1073741824, 3)) + "Gb" )
else :
MEMORYlist.append( str(m) + "%")
return MEMORYlist
and the result look like this :
['15.804Gb', '11.303Gb', '28.5%', '4.502Gb', '11.303Gb']
I wonder is there a better way to get same result. Thanks