Skip to content

Instantly share code, notes, and snippets.

@ooneko
Last active April 9, 2018 08:56
Show Gist options
  • Select an option

  • Save ooneko/4e508333b70c9dc2eec578faee3fad85 to your computer and use it in GitHub Desktop.

Select an option

Save ooneko/4e508333b70c9dc2eec578faee3fad85 to your computer and use it in GitHub Desktop.
import subprocess
subprocess.call(["ssh", "user@host"]);
# or execution a command
import subprocess
ret = subprocess.call(["ssh", "user@host", "program"]);
# or, with stderr:
prog = subprocess.Popen(["ssh", "user@host", "program"], stderr=subprocess.PIPE)
errdata = prog.communicate()[1]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment