Datasheet

Using the IronPython Console
17
displayed at each click point, as shown in Figure 1-8. If you look at the command prompt window at
this point, you’ll see that the mouse cursor is blinking but you cant type anything because the com-
mand prompt is waiting for the IronPython interpreter to end. When you click the Close button, the
application ends and you can again type something at the command prompt.
Understanding the IPY.EXE Standard Command Line Switches
Sometimes you need to provide IPY.EXE with more information
about a particular application. In this case, you can use one of
the command line switches shown in the following list to provide
IPY.EXE with the required information. Its important to note
that the command line switches are case sensitive;
–v isn’t the
same as
–V.
–3: Forces the interpreter to warn about Python 3 com-
patibility issues in your application.
–c cmd: Specifies a command you want to execute. This
command line switch must appear last on the line because
anything after this command line switch is interpreted as
a command you want to execute. For example, if you type
ipy -c “print (‘Hello‘)“, the interpreter will output
the word Hello.
–D: Enables application debugging.
–E: Ignores any environment variables that you specified as part of the Windows environment
variable setup or on the command line after you started it. Some applications may not run
after you use this command line switch because they wont be able to find modules and other
les they need.
–h: Displays a complete list of the command line arguments.
–i: Displays the console after running the script. You can then inspect the results of the
script using console commands.
–m module: Runs library module as a script.
–O: Tells the interpreter to generate optimized code, which means you cant perform debugging,
but the application will run faster.
–OO: Removes all of the doc strings and applies –O optimizations so that the application runs
even faster than using the
–O command line switch alone.
–Q arg: Specifies use of one of several division options. You can use any of these values.
–Qold
(default): The precision of the output depends on the operators used. For
example, if you divide two integers, you get an integer as output.
–Qwarn
: Outputs warnings about a loss of precision when performing division
using integers.
–Qwarnall
: Outputs warnings about all uses of the classic division operator.
–Qnew
: The output is always a precise floating point fraction.
FIGURE 18: The WFDemo shows
that you can create windowed
environments for IronPython
applications.
Hello
Hello
Hello
Hello
Hello Hello
548592c01.indd 17 2/24/10 12:47:13 PM