summaryrefslogtreecommitdiffstats
path: root/Doc/faq
diff options
context:
space:
mode:
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>2018-04-09 14:56:44 (GMT)
committerGitHub <noreply@github.com>2018-04-09 14:56:44 (GMT)
commitb571958f546b463656e9b60d4f50164e08d42b82 (patch)
tree7496ae42c620cbc395127a202eceac1fd80c8724 /Doc/faq
parentd964f51f813282171d4da831e8de0fe003253e9e (diff)
downloadcpython-b571958f546b463656e9b60d4f50164e08d42b82.zip
cpython-b571958f546b463656e9b60d4f50164e08d42b82.tar.gz
cpython-b571958f546b463656e9b60d4f50164e08d42b82.tar.bz2
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/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