A terminal is an interface for interacting with a computer. You input something (as “terminal” will normally refer to a text terminal, the something will be text), and that gets evaluated. Computers didn’t used to have GUIs, and you would interact with them by typing commands in. Nowadays you normally use a program called a terminal emulator to emulate that interface. GUIs are good for some things, text interfaces are good for other things.
python in a terminal, you get the Python REPL:
The terminal or console is not really going to store anything beyond what the last command was, you’re literally just telling the computer/application to do something, and they do it.
For example, in a folder
projects, I’ve run the command
ls is a utility program that, when invoked, lists all of the files/folders in the current directory, then exits, which is what this screenshot shows:
When you execute a Python script, what the computer will do is look for the Python executable, and use that to run whatever you tell it to run. ie if you have installed Python, it will come with a program that runs Python code which is normally invoked by typing
python myScript.py (where
myScript.py is some program you are trying to run). For example:
So in the folder
database-ops, I am
- running a Python script [which is in a file] called
- given some arguments (what I’m doing -
create, what I’m creating - a
proxy, the database I’m creating a proxy for - (redacted), and the port to use -
- creates a database proxy.
- The line after that shows the proxy has been created, and gives me some information (also redacted),
- then tells me how to connect to it using another program on my computer (
- So I use
psql with the arguments expected of it - it gives me a warning and asks for a password,
- which I give it,
- then it opens up the
psql console, which is a console program that lets me type in arbitrary SQL commands.
Re Google automatically running scripts - you’re going to have to be a lot more specific as to what you’re trying to do, because yes, out of the millions of tools Google provides, some can be scripted with Python, but Google has an awful lot of tools.