8000 mention the need for PythonEngine.Initialize and BeginAllowThreads in… · spsforks/pythonnet-pythonnet@85d0ca6 · GitHub
[go: up one dir, main page]

Skip to content

Commit 85d0ca6

Browse files
committed
mention the need for PythonEngine.Initialize and BeginAllowThreads in the README
1 parent a5e9b55 commit 85d0ca6

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-0
lines changed

README.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,8 @@ Embedding Python in .NET
5050
(internal, derived from ``MissingMethodException``) upon calling ``Initialize``.
5151
Typical values are ``python38.dll`` (Windows), ``libpython3.8.dylib`` (Mac),
5252
``libpython3.8.so`` (most other Unix-like operating systems).
53+
- Then call ``PythonEngine.Initialize()``. If you plan to use Python objects from
54+
multiple threads, also call ``PythonEngine.BeginAllowThreads()``.
5355
- All calls to python should be inside a
5456
``using (Py.GIL()) {/* Your code here */}`` block.
5557
- Import python modules using ``dynamic mod = Py.Import("mod")``, then

src/runtime/README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,9 @@ integrate Python engine and use Python libraries.
88
(internal, derived from `MissingMethodException`) upon calling `Initialize`.
99
Typical values are `python38.dll` (Windows), `libpython3.8.dylib` (Mac),
1010
`libpython3.8.so` (most other *nix). Full path may be required.
11+
- Then call `PythonEngine.Initialize()`. If you plan to [use Python objects from
12+
multiple threads](https://github.com/pythonnet/pythonnet/wiki/Threading),
13+
also call `PythonEngine.BeginAllowThreads()`.
1114
- All calls to Python should be inside a
1215
`using (Py.GIL()) {/* Your code here */}` block.
1316
- Import python modules using `dynamic mod = Py.Import("mod")`, then

0 commit comments

Comments
 (0)
0