I am running Python 2.7 in interactive mode in Terminal. If I make changes to the Python source or data file while the same is open in Python prompt, it doesn't appear to see the change, and exhibits the same behavior as if no change had been made.
When I quit()
Python and start it up again, then it registers the change.
Any ideas how do I achieve the desired? I also have Python 3.7 installed on my Mac. I am running macOS Sierra.
Best Answer
Use the
execfile(...)
built-in function, to reload the Python source file without quitting the interactive session.