Ich habe über die psutil Bibliothek sah (https://code.google.com/archive/p/psutil/wikis/Documentation.wiki) und bekam ein paar nützliche Dinge wieIch suche nach einem Pretty-Print eines Ubuntu-Prozesses mit Python. Ich lerne psutil kennen, aber keine Ahnung, ob es etwas Besseres gibt?
`` `
PROCESS_ATTRS = ['username', 'cpu_num', 'num_ctx_switches', 'pid', 'memory_full_info', 'connections', 'cmdline', 'create_time', 'ionice', 'num_fds', 'memory_maps', 'cpu_percent', 'terminal', 'ppid', 'cwd', 'nice', 'status', 'cpu_times', 'io_counters', 'memory_info', 'threads', 'open_files', 'uids', 'num_threads', 'exe', 'name', 'gids', 'cpu_affinity', 'memory_percent', 'environ']
for proc in psutil.process_iter():
print("Querying process: %s [%s]" % (proc.name(), proc.pid))
print proc.as_dict(attrs=PROCESS_ATTRS)
` ``
Gibt es eine andere Bibliothek für diese oder eine beliebige nützliche Methoden über psutil, die ich vermisse?
Vielen Dank im Voraus!