summaryrefslogtreecommitdiff
path: root/Doc/using
diff options
context:
space:
mode:
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>2018-04-09 07:56:44 -0700
committerGitHub <noreply@github.com>2018-04-09 07:56:44 -0700
commitb571958f546b463656e9b60d4f50164e08d42b82 (patch)
tree7496ae42c620cbc395127a202eceac1fd80c8724 /Doc/using
parentd964f51f813282171d4da831e8de0fe003253e9e (diff)
downloadcpython-git-b571958f546b463656e9b60d4f50164e08d42b82.tar.gz
Improve highlighting of some code blocks. (GH-6401)
(cherry picked from commit 46936d5a71d1683dbd8ddb6d7f39aab50ecfec50) Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
Diffstat (limited to 'Doc/using')
-rw-r--r--Doc/using/cmdline.rst12
-rw-r--r--Doc/using/unix.rst4
-rw-r--r--Doc/using/windows.rst20
3 files changed, 24 insertions, 12 deletions
diff --git a/Doc/using/cmdline.rst b/Doc/using/cmdline.rst
index 21ba0b5ceb..e72dea9075 100644
--- a/Doc/using/cmdline.rst
+++ b/Doc/using/cmdline.rst
@@ -178,11 +178,15 @@ Generic options
.. cmdoption:: -V
--version
- Print the Python version number and exit. Example output could be::
+ Print the Python version number and exit. Example output could be:
+
+ .. code-block:: none
Python 3.6.0b2+
- When given twice, print more information about the build, like::
+ When given twice, print more information about the build, like:
+
+ .. code-block:: none
Python 3.6.0b2+ (3.6:84a3c5003510+, Oct 26 2016, 02:33:55)
[GCC 6.2.0 20161005]
@@ -355,7 +359,9 @@ Miscellaneous options
Warning control. Python's warning machinery by default prints warning
messages to :data:`sys.stderr`. A typical warning message has the following
- form::
+ form:
+
+ .. code-block:: none
file:line: category: message
diff --git a/Doc/using/unix.rst b/Doc/using/unix.rst
index ac99b69986..8b392f8a56 100644
--- a/Doc/using/unix.rst
+++ b/Doc/using/unix.rst
@@ -118,7 +118,9 @@ Miscellaneous
=============
To easily use Python scripts on Unix, you need to make them executable,
-e.g. with ::
+e.g. with
+
+.. code-block:: shell-session
$ chmod +x script
diff --git a/Doc/using/windows.rst b/Doc/using/windows.rst
index 47d423f42d..3bab6fe503 100644
--- a/Doc/using/windows.rst
+++ b/Doc/using/windows.rst
@@ -210,7 +210,9 @@ The options listed above can also be provided in a file named ``unattend.xml``
alongside the executable. This file specifies a list of options and values.
When a value is provided as an attribute, it will be converted to a number if
possible. Values provided as element text are always left as strings. This
-example file sets the same options and the previous example::
+example file sets the same options and the previous example:
+
+.. code-block:: xml
<Options>
<Option Name="InstallAllUsers" Value="no" />
@@ -343,7 +345,9 @@ Windows allows environment variables to be configured permanently at both the
User level and the System level, or temporarily in a command prompt.
To temporarily set environment variables, open Command Prompt and use the
-:command:`set` command::
+:command:`set` command:
+
+.. code-block:: doscon
C:\>set PATH=C:\Program Files\Python 3.6;%PATH%
C:\>set PYTHONPATH=%PYTHONPATH%;C:\My_python_lib
@@ -503,7 +507,7 @@ From a script
Let's create a test Python script - create a file called ``hello.py`` with the
following contents
-::
+.. code-block:: python
#! python
import sys
@@ -518,7 +522,7 @@ From the directory in which hello.py lives, execute the command:
You should notice the version number of your latest Python 2.x installation
is printed. Now try changing the first line to be:
-::
+.. code-block:: python
#! python3
@@ -566,7 +570,7 @@ which interpreter to use. The supported virtual commands are:
For example, if the first line of your script starts with
-::
+.. code-block:: sh
#! /usr/bin/python
@@ -592,7 +596,7 @@ Arguments in shebang lines
The shebang lines can also specify additional options to be passed to the
Python interpreter. For example, if you have a shebang line:
-::
+.. code-block:: sh
#! /usr/bin/python -v
@@ -683,7 +687,7 @@ For example:
* Setting ``PY_PYTHON=3.1`` is equivalent to the INI file containing:
-::
+.. code-block:: ini
[defaults]
python=3.1
@@ -691,7 +695,7 @@ For example:
* Setting ``PY_PYTHON=3`` and ``PY_PYTHON3=3.1`` is equivalent to the INI file
containing:
-::
+.. code-block:: ini
[defaults]
python=3