Creating a Automated script in Python