I am using python2.7 to check if a service is running or not. I have made my own service and placed it inside /etc/init.d. I have a raspberry on which I am using it.
Now to normally check the status of service, we can do:
service my_service status
But how can I get the status of service from the python code.
Thanks