title: Run docker run command in python script
body: <p>I need to run following command inside python script to remove all exisiting docker services</p>
  
  <pre><code>import subprocess
  bashCommand = "docker service rm $(docker service ls)" 
  process = subprocess.Popen(bashCommand, stdout=subprocess.PIPE,  shell=True)
  </code></pre>
  
  <p>This is not giving desired results. Services still exists after running this file.
  I am using centos</p>