Skip to content

Instantly share code, notes, and snippets.

@xr09
Created March 2, 2015 14:14
Show Gist options
  • Select an option

  • Save xr09/db839751130b82aad1e1 to your computer and use it in GitHub Desktop.

Select an option

Save xr09/db839751130b82aad1e1 to your computer and use it in GitHub Desktop.
subprocess
import subprocess
command = subprocess.Popen( ["-c", "who | cut -d' ' -f1 | sort | uniq | grep -v root" ], stdout=subprocess.PIPE, shell=True )
users, err = command.communicate()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment