Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit a19ebdb

Browse files
committed
#17256: fix syntax highlight in embedding example. Patch by Kushal Das.
1 parent d69ad55 commit a19ebdb

1 file changed

Lines changed: 9 additions & 3 deletions

File tree

Doc/extending/embedding.rst

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,9 @@ This code loads a Python script using ``argv[1]``, and calls the function named
138138
in ``argv[2]``. Its integer arguments are the other values of the ``argv``
139139
array. If you :ref:`compile and link <compiling>` this program (let's call
140140
the finished executable :program:`call`), and use it to execute a Python
141-
script, such as::
141+
script, such as:
142+
143+
.. code-block:: python
142144
143145
def multiply(a,b):
144146
print("Will compute", a, "times", b)
@@ -238,7 +240,9 @@ following two statements before the call to :c:func:`Py_Initialize`::
238240

239241
These two lines initialize the ``numargs`` variable, and make the
240242
:func:`emb.numargs` function accessible to the embedded Python interpreter.
241-
With these extensions, the Python script can do things like ::
243+
With these extensions, the Python script can do things like
244+
245+
.. code-block:: python
242246
243247
import emb
244248
print("Number of arguments", emb.numargs())
@@ -303,7 +307,9 @@ examine Python's :file:`Makefile` (use :func:`sysconfig.get_makefile_filename`
303307
to find its location) and compilation
304308
options. In this case, the :mod:`sysconfig` module is a useful tool to
305309
programmatically extract the configuration values that you will want to
306-
combine together::
310+
combine together:
311+
312+
.. code-block:: python
307313
308314
>>> import sysconfig
309315
>>> sysconfig.get_config_var('LINKFORSHARED')

0 commit comments

Comments
 (0)