Skip to content

Instantly share code, notes, and snippets.

#!/usr/bin/env python
#
# Parse the output of lnstat(8) into something perhaps slightly
# human-readable.
#
# Can take input from a file or on stdin.
import sys
lnstat_output = open(sys.argv[1]) if len(sys.argv) >= 2 else sys.stdin