After you edit the python file on editer save it. And click Reload world 🔄 button. From then the simulation will start working with your new python code.