Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
P
pybind11
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
open
pybind11
Commits
8f6c1296
Commit
8f6c1296
authored
May 31, 2017
by
Dean Moldovan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix CMake example code in embedding docs
[skip ci]
parent
acedd6c7
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
3 additions
and
3 deletions
+3
-3
docs/advanced/embedding.rst
+2
-2
docs/compiling.rst
+1
-1
No files found.
docs/advanced/embedding.rst
View file @
8f6c1296
...
...
@@ -21,7 +21,7 @@ information, see :doc:`/compiling`.
find_package(pybind11 REQUIRED) # or `add_subdirectory(pybind11)`
add_executable(example
MODULE
main.cpp)
add_executable(example main.cpp)
target_link_libraries(example PRIVATE pybind11::embed)
The essential structure of the ``main.cpp`` file looks like this:
...
...
@@ -45,7 +45,7 @@ shuts down and clears its memory. No Python functions can be called after this.
Executing Python code
=====================
There are few different ways to run Python code. One option is to use `eval`,
There are
a
few different ways to run Python code. One option is to use `eval`,
`exec` or `eval_file`, as explained in :ref:`eval`. Here is a quick example in
the context of an executable with an embedded interpreter:
...
...
docs/compiling.rst
View file @
8f6c1296
...
...
@@ -203,7 +203,7 @@ information about usage in C++, see :doc:`/advanced/embedding`.
find_package(pybind11 REQUIRED) # or add_subdirectory(pybind11)
add_executable(example
MODULE
main.cpp)
add_executable(example main.cpp)
target_link_libraries(example PRIVATE pybind11::embed)
...
...
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