• Home
  • Raw
  • Download

Lines Matching +full:shebang +full:- +full:command

1 .. _tut-using:
8 .. _tut-invoking:
15 Unix shell's search path makes it possible to start it by typing the command:
17 .. code-block:: text
27 <windows-store>`, the :file:`python3.11` command will be available. If you have
29 command. See :ref:`setting-envvars` for other ways to launch Python.
31 Typing an end-of-file character (:kbd:`Control-D` on Unix, :kbd:`Control-Z` on
34 following command: ``quit()``.
36 The interpreter's line-editing features include interactive editing, history
39 Perhaps the quickest check to see whether command line editing is supported is
40 typing :kbd:`Control-P` to the first Python prompt you get. If it beeps, you
41 have command line editing; see Appendix :ref:`tut-interacting` for an
43 echoed, command line editing isn't available; you'll only be able to use
51 A second way of starting the interpreter is ``python -c command [arg] ...``,
52 which executes the statement(s) in *command*, analogous to the shell's
53 :option:`-c` option. Since Python statements often contain spaces or other
55 *command* in its entirety.
58 ``python -m module [arg] ...``, which executes the source file for *module* as
59 if you had spelled out its full name on the command line.
62 and enter interactive mode afterwards. This can be done by passing :option:`-i`
65 All command line options are described in :ref:`using-on-general`.
68 .. _tut-argpassing:
71 ----------------
78 ``'-'`` (meaning standard input), ``sys.argv[0]`` is set to ``'-'``. When
79 :option:`-c` *command* is used, ``sys.argv[0]`` is set to ``'-c'``. When
80 :option:`-m` *module* is used, ``sys.argv[0]`` is set to the full name of the
81 located module. Options found after :option:`-c` *command* or :option:`-m`
83 left in ``sys.argv`` for the command or module to handle.
86 .. _tut-interactive:
89 ----------------
92 mode*. In this mode it prompts for the next command with the *primary prompt*,
93 usually three greater-than signs (``>>>``); for continuation lines it prompts
98 .. code-block:: shell-session
108 Continuation lines are needed when entering a multi-line construct. As an
118 For more on interactive mode, see :ref:`tut-interac`.
121 .. _tut-interp:
127 .. _tut-source-encoding:
130 --------------------
132 By default, Python source files are treated as encoded in UTF-8. In that
134 in string literals, identifiers and comments --- although the standard library
137 recognize that the file is UTF-8, and it must use a font that supports all the
143 # -*- coding: encoding -*-
147 For example, to declare that Windows-1252 encoding is to be used, the first
150 # -*- coding: cp1252 -*-
153 :ref:`UNIX "shebang" line <tut-scripts>`. In this case, the encoding
157 # -*- coding: cp1252 -*-