@@ -377,7 +377,9 @@ An example of using these two classes follows (imports omitted)::
377377 root.warning('Look out!')
378378 listener.stop()
379379
380- which, when run, will produce::
380+ which, when run, will produce:
381+
382+ .. code-block :: none
381383
382384 MainThread: Look out!
383385
@@ -1860,7 +1862,9 @@ script, ``chowntest.py``::
18601862 logger = logging.getLogger('mylogger')
18611863 logger.debug('A debug message')
18621864
1863- To run this, you will probably need to run as ``root ``::
1865+ To run this, you will probably need to run as ``root ``:
1866+
1867+ .. code-block :: shell-session
18641868
18651869 $ sudo python3.3 chowntest.py
18661870 $ cat chowntest.log
@@ -2485,7 +2489,9 @@ via ``stderr`` and once via ``stdout``). After the ``with`` statement's
24852489completion, the status is as it was before so message #6 appears (like message
24862490#1) whereas message #7 doesn't (just like message #2).
24872491
2488- If we run the resulting script, the result is as follows::
2492+ If we run the resulting script, the result is as follows:
2493+
2494+ .. code-block :: shell-session
24892495
24902496 $ python logctx.py
24912497 1. This should appear just once on stderr.
@@ -2495,12 +2501,16 @@ If we run the resulting script, the result is as follows::
24952501 6. This should appear just once on stderr.
24962502
24972503 If we run it again, but pipe ``stderr `` to ``/dev/null ``, we see the following,
2498- which is the only message written to ``stdout ``::
2504+ which is the only message written to ``stdout ``:
2505+
2506+ .. code-block :: shell-session
24992507
25002508 $ python logctx.py 2>/dev/null
25012509 5. This should appear twice - once on stderr and once on stdout.
25022510
2503- Once again, but piping ``stdout `` to ``/dev/null ``, we get::
2511+ Once again, but piping ``stdout `` to ``/dev/null ``, we get:
2512+
2513+ .. code-block :: shell-session
25042514
25052515 $ python logctx.py >/dev/null
25062516 1. This should appear just once on stderr.
0 commit comments