Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
ff3f3336
Commit
ff3f3336
authored
Feb 22, 2013
by
Ezio Melotti
Browse files
Options
Browse Files
Download
Plain Diff
#17256: merge with 3.2.
parents
8c0bbfd1
a19ebdb4
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
3 deletions
+9
-3
Doc/extending/embedding.rst
Doc/extending/embedding.rst
+9
-3
No files found.
Doc/extending/embedding.rst
View file @
ff3f3336
...
...
@@ -138,7 +138,9 @@ This code loads a Python script using ``argv[1]``, and calls the function named
in ``argv[2]``. Its integer arguments are the other values of the ``argv``
array. If you :ref:`compile and link <compiling>` this program (let's call
the finished executable :program:`call`), and use it to execute a Python
script, such as::
script, such as:
.. code-block:: python
def multiply(a,b):
print("Will compute", a, "times", b)
...
...
@@ -238,7 +240,9 @@ following two statements before the call to :c:func:`Py_Initialize`::
These two lines initialize the ``numargs`` variable, and make the
:func:`emb.numargs` function accessible to the embedded Python interpreter.
With these extensions, the Python script can do things like ::
With these extensions, the Python script can do things like
.. code-block:: python
import emb
print("Number of arguments", emb.numargs())
...
...
@@ -303,7 +307,9 @@ examine Python's :file:`Makefile` (use :func:`sysconfig.get_makefile_filename`
to find its location) and compilation
options. In this case, the :mod:`sysconfig` module is a useful tool to
programmatically extract the configuration values that you will want to
combine together::
combine together:
.. code-block:: python
>>> import sysconfig
>>> sysconfig.get_config_var('LINKFORSHARED')
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment