Using the following code, I can get the memory consumption of the issuing process in MiB:
def memory_usage_psutil():
How can I change this to return the percentage of memory consumption?
Update . I need to get the current value of the %MEM column when I execute the top command in the terminal for a specific process.
Example : I need this function to return 14.2 for the process ID of the VirtualBox process.

source share