The Python interpreter is responsible to execute a series of Python commands and the python script that you are going to write pretty soon.
Just issue any command at the command prompt (>>>) and press enter. Python interpreter will take care of all the process. Often, the result is immediate.
Starting the interactive interpreter in Windows
To start the interactive interpreter, type the following command in windows command prompt:
When you start up Python, you get a prompt similar to the following:
Type "help", "copyright", "credits" or "license" for more information.
>>>
Starting the interactive interpreter in Linux/Unix
To start the interactive interpreter, type the following command in linux/unix shell:
When you start up Python, you get a prompt similar to the following:
[GCC 4.6.1] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>>
Write your first Python script
Let’s try to write few basic python scripts on the interpreter to experience how it works.
To print a line of string:
Hello World!
To add 2 numeric value:
18
To print decimal value of a hexadecimal number:
171
Python Tutorial: Using Interactive Python Interpreter