Changing the python script more accurately