Start restinput via python

When i want to start my program using restinput and custom action server, i have to type these command in the terminal: rasa run -m models --endpoints endpoints.yml --port 5002 --credentials credentials.yml and rasa run actions

Is there anyway that i can use python script to do these instead of terminal commands. Thanks in advance