Mention the need for `Initialize` and `BeginAllowThreads` in the README by lostmsu · Pull Request #1897 · pythonnet/pythonnet
Expand Up
@@ -8,6 +8,9 @@ integrate Python engine and use Python libraries.
(internal, derived from `MissingMethodException`) upon calling `Initialize`.
Typical values are `python38.dll` (Windows), `libpython3.8.dylib` (Mac),
`libpython3.8.so` (most other *nix). Full path may be required.
- Then call `PythonEngine.Initialize()`. If you plan to [use Python objects from
multiple threads](https://github.com/pythonnet/pythonnet/wiki/Threading),
also call `PythonEngine.BeginAllowThreads()`.
- All calls to Python should be inside a
`using (Py.GIL()) {/* Your code here */}` block.
- Import python modules using `dynamic mod = Py.Import("mod")`, then
Expand Down