Skip to content

Instantly share code, notes, and snippets.

@cahna
cahna / parse_ps_aux.py
Last active September 27, 2023 22:39
Parse the output of `ps aux` into a list of dictionaries representing the parsed process information from each row of the output.
#!/usr/bin/python
# -*- coding: utf-8 -*-
import pprint
import subprocess
def get_processes():
"""
Parse the output of `ps aux` into a list of dictionaries representing the parsed