mirror of
https://github.com/python/cpython.git
synced 2025-09-26 18:29:57 +00:00
Docs: Use substitutions instead of manual version updates (#115416)
This commit is contained in:
parent
f15795c9a0
commit
46245b0d83
4 changed files with 6 additions and 4 deletions
|
@ -66,6 +66,8 @@ version, release = patchlevel.get_version_info()
|
||||||
|
|
||||||
rst_epilog = f"""
|
rst_epilog = f"""
|
||||||
.. |python_version_literal| replace:: ``Python {version}``
|
.. |python_version_literal| replace:: ``Python {version}``
|
||||||
|
.. |python_x_dot_y_literal| replace:: ``python{version}``
|
||||||
|
.. |usr_local_bin_python_x_dot_y_literal| replace:: ``/usr/local/bin/python{version}``
|
||||||
"""
|
"""
|
||||||
|
|
||||||
# There are two options for replacing |today|: either, you set today to some
|
# There are two options for replacing |today|: either, you set today to some
|
||||||
|
|
|
@ -10,7 +10,7 @@ Using the Python Interpreter
|
||||||
Invoking the Interpreter
|
Invoking the Interpreter
|
||||||
========================
|
========================
|
||||||
|
|
||||||
The Python interpreter is usually installed as :file:`/usr/local/bin/python3.13`
|
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
|
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:
|
Unix shell's search path makes it possible to start it by typing the command:
|
||||||
|
|
||||||
|
@ -24,7 +24,7 @@ Python guru or system administrator. (E.g., :file:`/usr/local/python` is a
|
||||||
popular alternative location.)
|
popular alternative location.)
|
||||||
|
|
||||||
On Windows machines where you have installed Python from the :ref:`Microsoft Store
|
On Windows machines where you have installed Python from the :ref:`Microsoft Store
|
||||||
<windows-store>`, the :file:`python3.13` command will be available. If you have
|
<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`
|
the :ref:`py.exe launcher <launcher>` installed, you can use the :file:`py`
|
||||||
command. See :ref:`setting-envvars` for other ways to launch Python.
|
command. See :ref:`setting-envvars` for other ways to launch Python.
|
||||||
|
|
||||||
|
|
|
@ -15,7 +15,7 @@ operating system::
|
||||||
|
|
||||||
>>> import os
|
>>> import os
|
||||||
>>> os.getcwd() # Return the current working directory
|
>>> os.getcwd() # Return the current working directory
|
||||||
'C:\\Python312'
|
'C:\\Python313'
|
||||||
>>> os.chdir('/server/accesslogs') # Change current working directory
|
>>> os.chdir('/server/accesslogs') # Change current working directory
|
||||||
>>> os.system('mkdir today') # Run the command mkdir in the system shell
|
>>> os.system('mkdir today') # Run the command mkdir in the system shell
|
||||||
0
|
0
|
||||||
|
|
|
@ -279,7 +279,7 @@ applications include caching objects that are expensive to create::
|
||||||
Traceback (most recent call last):
|
Traceback (most recent call last):
|
||||||
File "<stdin>", line 1, in <module>
|
File "<stdin>", line 1, in <module>
|
||||||
d['primary'] # entry was automatically removed
|
d['primary'] # entry was automatically removed
|
||||||
File "C:/python312/lib/weakref.py", line 46, in __getitem__
|
File "C:/python313/lib/weakref.py", line 46, in __getitem__
|
||||||
o = self.data[key]()
|
o = self.data[key]()
|
||||||
KeyError: 'primary'
|
KeyError: 'primary'
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue