
上QQ阅读APP看书,第一时间看更新
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:
