- Python Programming with Raspberry Pi
- Sai Yamanoor Srihari Yamanoor
- 113字
- 2021-07-02 23:48:42
The text editor approach
The command-line tool is useful for test coding logic, but it is neither practical nor elegant to write code using the interactive tool. It is easier to write a bunch of code at a time and test it. Let's repeat the same example using IDLE's text editor:
- Launch IDLE's text editor (in IDLE, File | New File), enter the hello world line discussed in the previous section and save it as helloworld.py.
- Now, the code could be executed by either pressing the F5 key or clicking on Run Module from the drop-down menu Run, and you will get the output as shown in the following figure:
