Datasheet

18
CHAPTER 1 Discovering ironPython
–s: Specifies that the interpreter shouldn’t add the user site directory to sys.path.
–S: Specifies that the interpreter shouldn’t imply that it should execute the import site
command on initialization.
–t: Outputs warnings about inconsistent tab usage, which can lead to code interpretation
problems.
–tt: Outputs errors for inconsistent tab usage. Inconsistent tab usage can lead to code
interpretation problems, which can result in hard-to-locate bugs.
–u: Provides unbuffered stdout and stderr devices. Typically, the interpreter uses buffering
to provide better application performance.
–v: Specifies that the interpreter should provide verbose output, which means that you
can see everything going on in the background. You can also obtain this result by using
PYTHONVERBOSE=x (where x is a True or False environment variable).
–V: Prints the version number and exits. This option is useful when you want to be sure
youre using the correct version of IronPython for your application.
–W arg: Defines the kind of warning control. Specifying these command line switches tells
the interpreter to add the specified warning messages to the output. (Dont worry too much
about these warnings — you learn more about them in Chapter 12.) You can use any of
these values:
–W
action: Actions are one of the following strings: error (turns matching warnings
into exceptions),
ignore (never prints matching warnings), always (always prints
matching warnings),
default (prints the first occurrence of a warning for each loca-
tion where the interpreter issues the warning),
module (prints the first occurrence of
a warning for each module where the error occurs), and
once (prints only the first
occurrence of a warning no matter where it appears).
–W
message: Messages are Regular Expressions that define which warning messages
to match.
–W
category: Categories specify the class of the warning message.
–W
module: Modules are Regular Expressions that define which module to match.
–W
lineno: Line numbers are integer values that specify a line number to match.
Using 0 matches all line numbers.
–x: Skips the first line of the source code, which may have special instructions that you don’t
need for the current session.
IronPython doesn’t support all of the CPython command line switches.
Consequently, you may find that a batch file written to execute a CPython
application won’t work properly with IronPython. For example, IronPython
doesn’t appear to support the PYTHONHOME environment variable. All
IronPython environment variables begin with IRON, so you need to modify
batch files to include this first word as part of any environmental variable setup.
548592c01.indd 18 2/24/10 12:47:13 PM