class TestCLI(WrapperTester): (source)
Undocumented
Method | test |
When the copy of cli.exe, foo.exe in this example, runs, it examines the path name it was run with and computes a Python script path name by removing the '.exe' suffix and adding the '-script.py' suffix... |
Method | test |
Specifying Python Command-line Options -------------------------------------- |
Class Variable | script |
Undocumented |
Class Variable | script |
Undocumented |
Class Variable | wrapper |
Undocumented |
Class Variable | wrapper |
Undocumented |
Inherited from WrapperTester
:
Class Method | create |
Create a simple script, foo-script.py |
Class Method | prep |
Undocumented |
When the copy of cli.exe, foo.exe in this example, runs, it examines the path name it was run with and computes a Python script path name by removing the '.exe' suffix and adding the '-script.py' suffix. (For GUI programs, the suffix '-script.pyw' is added.) This is why we named out script the way we did. Now we can run out script by running the wrapper: This example was a little pathological in that it exercised windows (MS C runtime) quoting rules: - Strings containing spaces are surrounded by double quotes. - Double quotes in strings need to be escaped by preceding them with back slashes. - One or more backslashes preceding double quotes need to be escaped by preceding each of them with back slashes.
Specifying Python Command-line Options -------------------------------------- You can specify a single argument on the '#!' line. This can be used to specify Python options like -O, to run in optimized mode or -i to start the interactive interpreter. You can combine multiple options as usual. For example, to run in optimized mode and enter the interpreter after running the script, you could use -Oi: