A convenient thing to do when you are testing/debugging a program/python module is to create one terminal to the raspberry pi to use for editing, and when you are finished editing, save the module, but don't exit the editor.
Then in another terminal to the raspberry pi, use
to execute the module. If everything works, then great! But if something needs editing, go back to the other terminal/editing session, edit the module, save, then go back to the other terminal and execute again.
This is slightly faster than editing, exiting, executing, editing again, exiting, executing, etc. in one terminal only.