Skip to content

Instantly share code, notes, and snippets.

@bongbongco
Created October 13, 2017 01:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bongbongco/3d4515b34875dd24ff72bf5d856b38d3 to your computer and use it in GitHub Desktop.
Save bongbongco/3d4515b34875dd24ff72bf5d856b38d3 to your computer and use it in GitHub Desktop.
import multiprocessing
import paramiko
def f(*args):
ssh = paramiko.SSHClient()
ssh.set_missing_host_key_policy(paramiko.AutoAddPolicy())
ssh.connect('localhost', username='rpodolyaka')
stdin, stdout, stderr = ssh.exec_command('date')
return stdout.read()
if __name__ == "__main__":
pool = multiprocessing.Pool(10)
print pool.map(f, range(100))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment