Videos
From my understanding REPL is just a program or a high level shell for users to interact with it. In my CS class I was told how interpreted languages use it a lot, but it is not an interpreter though. If a REPL is not an interpreter, then what is the exact purpose of it? To me, all it seems like is a UI for user to write code in like a IDE in a way. Do all interpreters for interpreted languages need a REPL.
Finally, this stack overflow post: https://stackoverflow.com/questions/5451042/relation-between-repl-interpreter-and-compiler#:~:text=The%20REPL%20is%20commonly%20misnamed,as%20Common%20Lisp%20and%20Python.&text=An%20interpreter%20is%20not%20required%20to%20have%20one.
says how compilers or compiled languages may use it but my teacher told me how compiled languages do not use REPL. I apologize for the confusion or multiple questions, but I really wanted to clear my confusion as I learn more on how languages are set up and made.
I frequently use this:
def interact():
import code
code.InteractiveConsole(locals=globals()).interact()
You could try using the interactive option for python:
python -i program.py
This will execute the code in program.py, then go to the REPL. Anything you define or import in the top level of program.py will be available.