Hardware Reference
In-Depth Information
integrated development environment (IDE) such as IDLE, which provides Python-specific
functionality that's missing from a standard text editor, including syntax checking, debug-
ging facilities and the ability to run your program without having to leave the editor. This
chapter gives you instructions on how to create Python files using IDLE, but of course, the
IDE program that you choose to use for programming is up to you. The chapter also includes
instructions for running your created files directly from the terminal, which can be used in
conjunction with any text editor or other IDE.
To begin the Hello World project, open IDLE from the Programming menu in the Raspbian
distribution's desktop environment. If you're not using IDLE, create a blank document in
your favourite text editor and skip the rest of this paragraph. By default, IDLE opens up in
Python shell mode (see Figure 12-1), so anything you type in the initial window will be imme-
diately executed. To open a new Python project which can be executed later, click on the File
menu and choose New Window to open a blank file.
Figure 12-1:
he IDLE
Python Shell
window
Choosing IDLE 3 from the Programming menu instead of IDLE loads the Python 3.0 version.
This uses a subtly different form of the language, or syntax , which can cause problems with
programs written for Python 2. The examples in this chapter are all written with Python 2 in
mind, so be sure to load IDLE and not IDLE 3.
TIP
 
Search WWH ::




Custom Search