Interactive Interpreter

From IronPython Cookbook

(Difference between revisions)
Line 14: Line 14:
If you're not used to working at the command line on Windows, you might find the following article useful: [http://www.voidspace.org.uk/python/articles/command_line.shtml The Windows Command Line].
If you're not used to working at the command line on Windows, you might find the following article useful: [http://www.voidspace.org.uk/python/articles/command_line.shtml The Windows Command Line].
 +
 +
For help getting started with Python, see the resources in the [[Useful Links]] page.

Revision as of 15:48, 27 May 2007

The IronPython Interactive Interpreter

Both Python and IronPython can be used in interactive interpreter mode. This makes a great calculator, but is also a really good way of trying out language features or experimenting with libraries. You can also perform simple scripting tasks like inspecting files or databases.

To launch the interactive interpreter, run ipy.exe from the command line.

Individual commands, or blocks of code, can be typed here and are executed immediately. The results are displayed in the console window. You can access the last result through the magic variable '_'.

ipy.exe comes in the IronPython zipfile, which also has a tutorial to help you get started.

To enable syntax highlighting and tab completion in the interpreter, start ipy with the following arguments:

   ipy -D -X:TabCompletion -X:ColorfulConsole 

If you're not used to working at the command line on Windows, you might find the following article useful: The Windows Command Line.

For help getting started with Python, see the resources in the Useful Links page.

TOOLBOX
LANGUAGES