How to automate python