Datasheet

Using the IronPython Console
13
Notice that the top of the window tells you which version of IronPython youre using and which version
of the .NET Framework it’s running on. This is important information because it helps you understand
the IronPython environment and what limitations you have when working with IronPython. Below this
rst line, you’ll see some commands that Microsoft thought you might find useful. The “Getting Help
with Any Function” section of the chapter tells you more about the Help command.
To use the console, simply type the commands you want to issue. When youre done, IronPython
will execute the commands and output any result you requested. A command need not be a function
call or an object instantiation as it is in other languages. For example, type
2 + 2 right now and
then press Enter. You’ll see the result of this simple command, as shown in Figure 1-4.
FIGURE 14: IronPython is dynamic and the console is interactive.
Whenever you want to end a particular task, such as working with Help, press Enter a second time.
The console will take you to the previous level of interaction.
Getting Help with Any Function
You can get help with any function in the console. If you simply type help and press Enter in the
console, IronPython tells you how to request interactive help or help about a specific object. To
begin interactive help, type
help() and press Enter. You’ll see the interactive help display shown
in Figure 1-5.
FIGURE 15: Interactive help lets you ask questions about IronPython.
548592c01.indd 13 2/24/10 12:47:12 PM