#!/usr/local/bin/python3 import subprocess; import os; x=open("blahblahblah", "w+"); print([subprocess.check_output(['lsof', '-wXFn', '+p', str(pid)], stdout=x) for pid in range(999)])