-
-
Notifications
You must be signed in to change notification settings - Fork 33.2k
Improved documentation: Updated clarity in 'Using the Python Interpreter' section #129235
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -11,8 +11,8 @@ Invoking the Interpreter | |
| ======================== | ||
|
|
||
| The Python interpreter is usually installed as |usr_local_bin_python_x_dot_y_literal| | ||
| on those machines where it is available; putting :file:`/usr/local/bin` in your | ||
| Unix shell's search path makes it possible to start it by typing the command: | ||
| on those machines where it is available; Ensure /usr/local/bin is included in your Unix | ||
| shell's search path to start the interpreter by typing the command: | ||
|
|
||
| .. code-block:: text | ||
|
|
||
|
|
@@ -23,10 +23,10 @@ is an installation option, other places are possible; check with your local | |
| Python guru or system administrator. (E.g., :file:`/usr/local/python` is a | ||
| popular alternative location.) | ||
|
|
||
| On Windows machines where you have installed Python from the :ref:`Microsoft Store | ||
| <windows-store>`, the |python_x_dot_y_literal| command will be available. If you have | ||
| the :ref:`py.exe launcher <launcher>` installed, you can use the :file:`py` | ||
| command. See :ref:`setting-envvars` for other ways to launch Python. | ||
| On Windows, if you installed Python from the :ref:Microsoft Store <windows-store>, | ||
| the |python_x_dot_y_literal| command will be available. Alternatively, if you have the | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. AFAIK, you might have both installed so it's not really "alternatively". Also, we should keep the mention about setting environment variables because it's relevant. |
||
| :ref:py.exe launcher <launcher> installed, you can use the :file:py command to launch | ||
| Python. | ||
|
|
||
| Typing an end-of-file character (:kbd:`Control-D` on Unix, :kbd:`Control-Z` on | ||
| Windows) at the primary prompt causes the interpreter to exit with a zero exit | ||
|
|
@@ -37,7 +37,8 @@ The interpreter's line-editing features include interactive editing, history | |
| substitution and code completion on systems that support the `GNU Readline | ||
| <https://tiswww.case.edu/php/chet/readline/rltop.html>`_ library. | ||
| Perhaps the quickest check to see whether command line editing is supported is | ||
| typing :kbd:`Control-P` to the first Python prompt you get. If it beeps, you | ||
| typing :kbd:`Control-P` to the first Python prompt you get. i.e. Pressing :kbd:Control-P | ||
| moves to the previous command in the command history. If it beeps, you | ||
|
Comment on lines
+40
to
+41
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This change doesn't seem typographically correct and the markup is incorrect. |
||
| have command line editing; see Appendix :ref:`tut-interacting` for an | ||
| introduction to the keys. If nothing appears to happen, or if ``^P`` is | ||
| echoed, command line editing isn't available; you'll only be able to use | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -40,7 +40,9 @@ def as_list(self): | |
| self.lflag, | ||
| self.ispeed, | ||
| self.ospeed, | ||
| self.cc, | ||
| # Always return a copy of the control characters list to ensure | ||
| # there are not any additional references to self.cc | ||
| self.cc[:], | ||
|
Comment on lines
+43
to
+45
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is an unrelated change. |
||
| ] | ||
|
|
||
| def copy(self): | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| Restore terminal control characters on REPL exit. | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Please also remove this along with the unrelated change. |
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please keep lines under 80 chars as per PEP8.