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