Automating the tasks with Python