110
❘
CHAPTER 6
Using the Python standard Library
The item of special interest on the General page is the Additional Help Sources list at the bottom of
the page. To add a new help source, click Add. You’ll see the New Help Source dialog box shown in
Figure 6-12. Notice that you can use either a local help source or a remote help URL. IronPython
developers have good reason to add other help sources they can use for IronPython-specific needs.
IronPython doesn’t provide a lot of specific help sources, but it does provide some. The following list
provides some suggestions of URLs you might want to add to your copy of IDLE.
➤➤
Differences between IronPython 2.0.
x
and CPython 2.5.2:
http://ironpython.codeplex.com/
wikipage?title=IPy2.0.xCPyDifferences
➤
➤
IronPython Readme:
/Program Files/IronPython 2.6/
Readme.html
➤
➤
IronPython Tutorial:
/Program Files/IronPython 2.6/
Tutorial/Tutorial.htm
➤
➤
IronPython Samples:
http://ironpython.codeplex.com/
wikipage?title=Samples
➤
➤
More Information About IronPython:
http://ironpython
.codeplex.com/wikipage?title=More Information
Performing an Interactive Edit
To use IDLE as an editor, you simply begin entering commands in the Shell Window. If you have
IDLE configured to open the Editor Window first, choose Run
➤➤➪➤➤
Python Shell to open the Shell
Window. The interpreter will tell you the result of each command you enter, so you know immedi-
ately whether the command will work. After you’ve completed the task you want to perform, choose
File
➤➤➪➤➤
Save and save the file. At this point, IDLE will save everything you typed, some of which isn’t
useful for an application, so you need to edit the code.
If you haven’t already configured IDLE to open the Editor Window first, do so now. Choose Options
➤➤➪➤➤
Configure IDLE, select Open Edit Window in the At Startup section on the General tab, and click OK.
Choose File
➤➤➪➤➤
New Window. IDLE will open an Editor Window that you can use to edit the code you
just created interactively.
In the Editor Window, choose File
➤➤➪➤➤
Open. You’ll see an Open dialog box like the one shown in
Figure 6-13. Select the file you just saved and click Open. IDLE opens the file you saved from your
interpreter section.
Figure 6-14 shows a short example of an interpreter session saved as a file. As you can see, you need
to perform a number of edits, such as removing the initial startup information. Modify the file just
as you would using any other editor and save the result. The Edit menu contains a full list of editing
tools, including the familiar Cut, Copy, and Paste commands, as well as a Find command. It even
includes a command to go directly to a specific line in the file, Edit
➤➤➪➤➤
Go To Line, which comes in
handy for dealing with interpreter error messages.
Do'stlaringiz bilan baham: