summaryrefslogtreecommitdiffstats
path: root/Doc/faq
diff options
context:
space:
mode:
authorSerhiy Storchaka <storchaka@gmail.com>2018-04-08 16:18:04 (GMT)
committerGitHub <noreply@github.com>2018-04-08 16:18:04 (GMT)
commit46936d5a71d1683dbd8ddb6d7f39aab50ecfec50 (patch)
tree1f51e69c1fbb9401516478b8866d01f1513644cb /Doc/faq
parent9265dd72e5ec1cfa5fcdb5be8ebffe1d9994bd4b (diff)
downloadcpython-46936d5a71d1683dbd8ddb6d7f39aab50ecfec50.zip
cpython-46936d5a71d1683dbd8ddb6d7f39aab50ecfec50.tar.gz
cpython-46936d5a71d1683dbd8ddb6d7f39aab50ecfec50.tar.bz2
Improve highlighting of some code blocks. (GH-6401)
Diffstat (limited to 'Doc/faq')
-rw-r--r--Doc/faq/library.rst4
-rw-r--r--Doc/faq/windows.rst26
2 files changed, 23 insertions, 7 deletions
diff --git a/Doc/faq/library.rst b/Doc/faq/library.rst
index f84fead..aec4bf9 100644
--- a/Doc/faq/library.rst
+++ b/Doc/faq/library.rst
@@ -74,7 +74,9 @@ interpreter.
Occasionally, a user's environment is so full that the :program:`/usr/bin/env`
program fails; or there's no env program at all. In that case, you can try the
-following hack (due to Alex Rezinsky)::
+following hack (due to Alex Rezinsky):
+
+.. code-block:: sh
#! /bin/sh
""":"
diff --git a/Doc/faq/windows.rst b/Doc/faq/windows.rst
index f049bc8..7792cfa 100644
--- a/Doc/faq/windows.rst
+++ b/Doc/faq/windows.rst
@@ -1,5 +1,7 @@
:tocdepth: 2
+.. highlightlang:: none
+
.. _windows-faq:
=====================
@@ -39,12 +41,16 @@ or "Command prompt window". Usually you can create such a window from your
Start menu; under Windows 7 the menu selection is :menuselection:`Start -->
Programs --> Accessories --> Command Prompt`. You should be able to recognize
when you have started such a window because you will see a Windows "command
-prompt", which usually looks like this::
+prompt", which usually looks like this:
+
+.. code-block:: doscon
C:\>
The letter may be different, and there might be other things after it, so you
-might just as easily see something like::
+might just as easily see something like:
+
+.. code-block:: doscon
D:\YourName\Projects\Python>
@@ -60,11 +66,15 @@ program. So, how do you arrange for the interpreter to handle your Python?
First, you need to make sure that your command window recognises the word
"python" as an instruction to start the interpreter. If you have opened a
command window, you should try entering the command ``python`` and hitting
-return::
+return:
+
+.. code-block:: doscon
C:\Users\YourName> python
-You should then see something like::
+You should then see something like:
+
+.. code-block:: pycon
Python 3.3.0 (v3.3.0:bd8afb90ebf2, Sep 29 2012, 10:55:48) [MSC v.1600 32 bit (Intel)] on win32
Type "help", "copyright", "credits" or "license" for more information.
@@ -73,7 +83,9 @@ You should then see something like::
You have started the interpreter in "interactive mode". That means you can enter
Python statements or expressions interactively and have them executed or
evaluated while you wait. This is one of Python's strongest features. Check it
-by entering a few expressions of your choice and seeing the results::
+by entering a few expressions of your choice and seeing the results:
+
+.. code-block:: pycon
>>> print("Hello")
Hello
@@ -317,7 +329,9 @@ present, and ``getch()`` which gets one character without echoing it.
How do I emulate os.kill() in Windows?
--------------------------------------
-Prior to Python 2.7 and 3.2, to terminate a process, you can use :mod:`ctypes`::
+Prior to Python 2.7 and 3.2, to terminate a process, you can use :mod:`ctypes`:
+
+.. code-block:: python
import ctypes