how to use python for task automation