Run an python script when button is clicked

Is it possible to run a python script when a custom button is clicked in chatbot. I have tried to include os.system(“script.py”) in run() of action.py file but its not working.