Skip to content

Instantly share code, notes, and snippets.

@rootcss
Created April 6, 2018 10:11
Show Gist options
  • Select an option

  • Save rootcss/04d8e1a7151f22842b8d690202c2680c to your computer and use it in GitHub Desktop.

Select an option

Save rootcss/04d8e1a7151f22842b8d690202c2680c to your computer and use it in GitHub Desktop.
import subprocess
from threading import Thread
def call_subprocess(cmd):
proc = subprocess.Popen(cmd, shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
out, err = proc.communicate()
if err:
print(err)
thread = Thread(target=call_subprocess, args=['pip install --upgrade pip && pip install pysftp'])
thread.start()
thread.join()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment