User manual
13
Python 2.7.3 is started with the icon
IDLE
on the desktop. A command window with a command
prompt appears on the desktop, which looks simple at a first glance.
Fig. 1.6: The input window of the Python shell.
In this window you can open existing Python programs, write new ones or you can directly execute Python
commands interactively, without having to write a real programme. For example, in the prompt type the
following:
>>> 1+2
The correct answer is shown immediately:
3
Python can be used as a handy calculator, but that has nothing whatsoever to do with programming. Usually
programming courses start with
Hello World
programs, which write the phrase “Hello World” on the screen.
That is so simple in Python that it is not even worth to run it under its own heading. Simply type the
following line in the Python shell window:
>>> print “Hello World”
This first “program” then writes Hello World in the next row on the screen.
Fig. 1.7: »Hello World« in Python (further up you can still see the calculation output).
You can also see here that the Python shell automatically uses different text colors for reasons of clarity.
Python commands are orange, strings are green and results are blue. Later on you will discover some more
colors.