Python Programming for Raspberry Pi, Sams Teach Yourself in 24 Hours

(singke) #1
the LXDE GUI. However, you can use the Python interactive shell at the command line,
too.

Figure 3.3 shows a Python statement involving the print function: print ("I love my
Raspberry Pi!"). The Python interactive shell interprets, converts, and executes the command
and then prints I love my Raspberry Pi! to the screen.


FIGURE 3.3 The print function in the Python interactive shell.

To get help using the interactive shell or Python statements, you can type help() and press Enter.
Figure 3.4 shows the interactive shell’s help utility.


FIGURE 3.4 Interactive shell help.

You can type in a Python keyword, module, or topic to get help on it. To exit help on a particular
keyword, module, or topic, press the Q key. To exit the interactive shell’s help utility, press the Ctrl
key and hold it. Then press and release the D key. This combination is written Ctrl+D. Instead, you
can type quit and press Enter.


When you are done using the Python interactive shell, simply type exit () and press Enter. Python
takes you out of the interactive shell and puts you back to the command line.

Free download pdf