Is there a way to execute a Python script, yet stay in the Python shell thereafter, so that variable values could be inspected and such?
2 Answers
Metaphox nailed it:
I think you are looking for python -i ./file.py, where the -i flag will enter interactive mode after executing the file. If you are already in the console, then execfile. – Metaphox 2 mins ago
But I want to thank for the other suggestions as well, which go beyond the original question yet are useful!
execfilefit what you need? stackoverflow.com/questions/5280178/…python -i ./file.py, where the-iflag will enter interactive mode after executing the file. If you are already in the console, thenexecfile.