Read Eval Print Loop

REPL is a simple, interactive computer programming environment that takes single user inputs, executes them, and returns the result.

python

Flow:

read one input
compile to bytecode
execute
print result if needed
repeat

The REPL keeps state between inputs.

Difference between running the Python REPL vs. on a file?

REPL compiles python program to bytecode one input at a time, whereas running it on a file compiles thel whole file/module at once.