import psutil
applist = list(psutil.process_iter())
for app in applist:
print(app)
It's a script to get running Process in macOS, I got the list and it showed
psutil.Process(pid=12723, name='Google Chrome', status='running', started='13:54:23')
But I only want to get the 'Google Chrome' part, how can I do that? I want to use split()
, but it said 'Process' object has no attribute 'split'
.