title: run shell command on a cluster using python
body: <p>I want/am trying to run shell command(Usually file manipulation) on a cluster(a spark cluster 1 master and 3 worker node).</p>
  
  <p>There is passwordless ssh between all the machines in the cluster.</p>
  
  <p>File directories are all same on all cluster Nodes.</p>
  
  <p>Currently I am handling  file manipulation shell command by</p>
  
  <pre><code> #let's say copy or move a file from one dir to other dir
   import os, sys
   os.system('ssh user@Ip_of_worker-1 "cp directory_1/file1.csv directory_2"')
   os.system('ssh user@Ip_of_worker-2 "cp directory_1/file1.csv directory_2"')
   os.system('ssh user@Ip_of_worker-3 "cp directory_1/file1.csv directory_2"')
  </code></pre>
  
  <p>And I am looking for a python package to do that, generally I am trying to avoid system call every time I want to run a shell command(I should get stdout &amp; stderr for each command run on different cluster_Nodes in running python script log.).</p>
  
  <p>And shell command should run in parallel/simultaneously on all target Nodes.</p>
  
  <p>Please guide, if any such package you guys are aware of or have used before.</p>