- - - - - - - - - -
Long answer
- - - - - - - - - -
When you run a python script (a file with python code), you invoke the Python Interpreter and pass it the name and path of your file, perhaps with some other optional arguments. This is done in the shell (the command line).
Python runs your script and if you have some print statements in there it will print whatever it's supposed to print in the same console window. When it's done executing all the code the Python Interpreter closes itself and the console window that it opened.
Now there is another mode which you mentioned called the Interactive Mode. This interactive mode is a program just like the Python Interpreter is a program. What it does is it displays a prompt called the primary prompt ">>>" and when you give it some code, it executes that code and displays the result on the screen, then it prompts you again ">>>". This all happens in a loop called a read-eval-print loop, because it reads the code you type in, eval means it executes it, and print means it displays the result back to you even if you didn't explicitly ask it to print.
So basically, the interactive mode is just a feature of Python, a tool for running code interactively and one of the differences between that and simply running a script is that for it to be interactive it has to constantly communicate with you and it does that by printing the result on the screen, by design.
When you run a script the reason it doesn't show up is because you have to explicitly tell it to print, it's not interactive anymore so it's going to behave like any normal programming language and do only what you tell it to.
- - - - - - - - - -
Short answer
- - - - - - - - - -
Normally, Python will display something on the screen only if you tell it to or if it encounters and error.
Pythons interactive mode (prompt mode) on the other hand is a small program/tool for using Python in an interactive way. The word interactive implies a higher level of feedback and this means that it will take it's own initiative to uphold the definition of interactive by printing the repr() (object representation) of a value on the screen if you don't explicitly tell it what to print.