Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit dd01080

Browse files
committed
Mention "-c command" option.
1 parent 689e701 commit dd01080

2 files changed

Lines changed: 12 additions & 4 deletions

File tree

Doc/tut.tex

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -169,12 +169,16 @@ \section{Using the Python Interpreter}
169169
you want) they are satisfied from whatever file or device is
170170
connected to standard input of the Python interpreter.
171171
}
172-
If available, the script name and additional arguments thereafter are
172+
A third possibility is ``{\tt python -c command [arg] ...}'', which
173+
executes the statement(s) in {\tt command}, in analogy of the shell's
174+
{\tt -c} option.
175+
When available, the script name and additional arguments thereafter are
173176
passed to the script in the variable
174177
{\tt sys.argv},
175178
which is a list of strings.
179+
When {\tt -c command} is used, {\tt sys.argv} is set to {\tt '-c'}.
176180

177-
When standard input is a tty, the interpreter is said to be in
181+
When commands are read from a tty, the interpreter is said to be in
178182
{\em interactive\ mode}.
179183
In this mode it prompts for the next command with the
180184
{\em primary\ prompt},

Doc/tut/tut.tex

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -169,12 +169,16 @@ \section{Using the Python Interpreter}
169169
you want) they are satisfied from whatever file or device is
170170
connected to standard input of the Python interpreter.
171171
}
172-
If available, the script name and additional arguments thereafter are
172+
A third possibility is ``{\tt python -c command [arg] ...}'', which
173+
executes the statement(s) in {\tt command}, in analogy of the shell's
174+
{\tt -c} option.
175+
When available, the script name and additional arguments thereafter are
173176
passed to the script in the variable
174177
{\tt sys.argv},
175178
which is a list of strings.
179+
When {\tt -c command} is used, {\tt sys.argv} is set to {\tt '-c'}.
176180

177-
When standard input is a tty, the interpreter is said to be in
181+
When commands are read from a tty, the interpreter is said to be in
178182
{\em interactive\ mode}.
179183
In this mode it prompts for the next command with the
180184
{\em primary\ prompt},

0 commit comments

Comments
 (0)