i want to convert my Bash Script to pyhton script. how can i do that? here is my bash script [closed]

  python
#!/bin/sh
list_of_containers="homeassistant addon_a0d7b954_appdaemon3 hassio_supervisor"
containers=`docker ps -f status=running --format "{{.Names}}"`
for container in $list_of_containers
do
  if echo $containers |grep -q $container
    then  echo "$container online "
  else echo "$container offline"
    exit 1
  fi
done
exit 0

Source: Python Questions

LEAVE A COMMENT