I have a script
python -i foo.py
There is still nothing built-in to provide the exact functionality you describe. However, an alternative to using
require it to use the
.load command within the REPL, like such:
It loads the file in line by line just as if you had typed it in the REPL. Unlike
require this pollutes the REPL history with the commands you loaded. However, it has the advantage of being repeatable because it is not cached like
Which is better for you will depend on your use case.