|
Original |
Translation |
|
17
|
An interface option terminates the list of options consumed by the interpreter, all consecutive arguments will end up in :data:`sys.argv` -- note that the first element, subscript zero (``sys.argv[0]``), is a string reflecting the program's source.
|
|
|
18
|
Execute the Python code in *command*. *command* can be one ore more statements separated by newlines, with significant leading whitespace as in normal module code.
|
|
|
19
|
If this option is given, the first element of :data:`sys.argv` will be ``"-c"`` and the current directory will be added to the start of :data:`sys.path` (allowing modules in that directory to be imported as top level modules).
|
|
|
20
|
Search :data:`sys.path` for the named module and execute its contents as the :mod:`__main__` module.
|
|
|
21
|
|
22
|
Package names are also permitted. When a package name is supplied instead of a normal module, the interpreter will execute ``<pkg>.__main__`` as the main module. This behaviour is deliberately similar to the handling of directories and zipfiles that are passed to the interpreter as the script argument.
|
|
|
23
|
This option cannot be used with built-in modules and extension modules written in C, since they do not have Python module files. However, it can still be used for precompiled modules, even if the original source file is not available.
|
|
|
24
|
If this option is given, the first element of :data:`sys.argv` will be the full path to the module file. As with the :option:`-c` option, the current directory will be added to the start of :data:`sys.path`.
|
|
|
25
|
Many standard library modules contain code that is invoked on their execution as a script. An example is the :mod:`timeit` module::
|
|
|
26
|
python -mtimeit -s 'setup here' 'benchmarked code here' python -mtimeit -h # for details
|
|