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

(singke) #1

  1. When the next window says Please select the model of the keyboard for
    this machine., press Enter to accept the default selection.

  2. When the next window says Please select the layout matching the
    keyboard for this machine, press the up-arrow key to scroll up the menu until you
    get to English (US). Press Enter.


Watch Out!: The Wrong Keyboard
If you are using a special keyboard, such as a Dvorak keyboard, the English (US)
selection will not work for your keyboard, and you will end up having keys on the
keyboard not producing the correct letters. This could prevent you from logging back in
to your Raspberry Pi!
If you have a special keyboard, scroll through the selections in this window and pick
the one that best matches your needs. If something goes wrong and your keyboard acts
funny, don’t worry. You can go back to Hour 1, “Setting Up the Raspberry Pi,” and put
a fresh copy of the Raspbian operating system image onto your SD card to get back to
“normal” keyboard operations.


  1. On the next three screens listed, modify the selections or press Enter to accept the defaults:
    Key to function as AltGr screen
    Compost Key screen
    Use Control Alt Backspace screen

  2. In the Raspbi-config window, press Tab until you reach the selection and
    then press Enter.

  3. Because the keyboard changes will not take effect until you reboot your system, type sudo
    reboot in the LXTerminal window and press Enter.

  4. After your Raspberry Pi reboots, test your keyboard. See if pressing the @ key now produces
    the symbol @ and pressing the " key produces a double quote (").


Remember that you can fix any disasters here by going back to Hour 1 and putting a fresh copy of the
Raspbian operating system image onto your SD card. Doing so will get you back to “normal”
keyboard operations.


Learning About the Python Interpreter


Python is an interpreted programming language, instead of a compiled one. A compiled programming
language has all its program’s language statements (commands) turned into binary code at once,
before it can be executed (run). With an interpreted programming language, each of its programming
statements, one at a time, is checked for syntax errors, translated into binary code, and then executed.


You can learn about a variety of Python statements and concepts by using different tools that fall into
three primary categories:


Interactive shell—The interactive shell allows you to enter a single Python statement and have
it immediately checked for errors and interpreted.
Development environment shell—This tool provides many features to assist in the
Free download pdf