Linux Format

Be an IDLE fellow

-

Creating a Python script can be as simple as using your favourite text editor to create a file with the extension .py, then adding your code. However, this can prove tricky when it comes to indenting lines as well as when you’re making minor revisions and need a way to execute your scripts quickly each time.

IDLE is Python’s integrated developmen­t and learning environmen­t. IDLE includes a multiwindo­w text editor with features above and beyond simple word processing programs such as smart indents, call tips and auto complete of common terms. Once a script has been saved, you can launch it using IDLE’s Python shell window by pressing F5. This is ideal for interactiv­e scripts as the window automatica­lly colourises input, output and error messages.

IDLE is a cross platform applicatio­n. If you have a Raspberry Pi, you’ll find it preinstall­ed in the Programmin­g section of the Applicatio­ns menu – choose Python 3 (IDLE) for this tutorial. IDLE is also installed in Ubuntu repositori­es. Simply open Terminal and run sudo apt-get

update then sudo apt-get install idle3 . The Python website has an extensive user manual for IDLE. Visit https://docs.python.

org/3/library/idle.html for more informatio­n. For the purposes of this tutorial, remember that after you’ve executed a script you can continue to interact with it through entering commands via the shell window, for example to append an element to an array.

 ??  ?? IDLE comes preinstall­ed for both Python 2 and 3 in Raspbian. The program is available in the repositori­es of most flavours of Linux.
IDLE comes preinstall­ed for both Python 2 and 3 in Raspbian. The program is available in the repositori­es of most flavours of Linux.

Newspapers in English

Newspapers from Australia