Page 41 -
P. 41
meet python
Work effectively with IDLE
This is how IDLE looks on
IDLE has lots of features, but you need to know about only
a few of them to get going. my computer. It might look a
little different on yours, but
TAB completion not by much. (And, yes, it’s
meant to look this ugly.)
Start to type in some code, and then press the TAB key.
IDLE will offer suggestions to help you complete your
statement.
Type “pr” and then
TAB at the >>> prompt
to see IDLE’s list of
command completion
suggestions.
Recall code statements
Alt-P for Previous
Press Alt-P to recall the previous code statement entered into
IDLE or press Alt-N to move to the next code statement
(assuming there is one). Both key combinations can be used Alt-N for Next
to cycle rapidly through all of the code you’ve entered into
IDLE, re-executing any code statements as needed.
Unless you’re on
Edit recalled code a Mac, in which
case it’s Ctrl-P
Once you recall your code statement, you can edit it and and Ctrl-N.
move around the statement using the arrow keys. It’s
possible to edit any statement that you’ve previously
entered, even code statements that span multiple lines.
Adjust IDLE’s preferences
IDLE’s preferences dialog lets you adjust its default Tweak IDLE
behavior to your tastes. There are four tabs of settings to to your heart’s
tweak. You can control font and tab behavior, the colors content.
used to syntax highlight, the behavior of certain key-
combinations, and IDLE’s start-up settings. So, if shocking
pink strings is really your thing, IDLE gives you the power
to change how your code looks on screen.
you are here 4 5