@@ -17,11 +17,6 @@ provides a powerful application scripting tool for .NET developers. It
1717allows Python code to interact with the CLR, and may also be used to
1818embed Python into a .NET application.
1919
20- .. note ::
21- The master branch of this repository tracks the ongoing development of version 3.0.
22- Backports of patches to 2.5 are tracked in the
23- `backports-2.5 branch <https://github.com/pythonnet/pythonnet/tree/backports-2.5 >`_.
24-
2520Calling .NET code from Python
2621-----------------------------
2722
@@ -42,6 +37,25 @@ module:
4237 clr.AddReference(" System.Windows.Forms" )
4338 from System.Windows.Forms import Form
4439
40+ By default, Mono will be used on Linux and macOS, .NET Framework on Windows. For
41+ details on the loading of different runtimes, please refer to the documentation.
42+
43+ .NET Core
44+ ~~~~~~~~~
45+
46+ If .NET Core is installed in a default location or the ``dotnet `` CLI tool is on
47+ the ``PATH ``, loading it instead of the default (Mono/.NET Framework) runtime
48+ just requires setting either the environment variable
49+ ``PYTHONNET_RUNTIME=coreclr `` or calling ``pythonnet.load `` explicitly:
50+
51+ .. code-block :: python
52+
53+ from pythonnet import load
54+ load(" coreclr" )
55+
56+ import clr
57+
58+
4559 Embedding Python in .NET
4660------------------------
4761
@@ -50,6 +64,8 @@ Embedding Python in .NET
5064 (internal, derived from ``MissingMethodException ``) upon calling ``Initialize ``.
5165 Typical values are ``python38.dll `` (Windows), ``libpython3.8.dylib `` (Mac),
5266 ``libpython3.8.so `` (most other Unix-like operating systems).
67+ - Then call ``PythonEngine.Initialize() ``. If you plan to use Python objects from
68+ multiple threads, also call ``PythonEngine.BeginAllowThreads() ``.
5369- All calls to python should be inside a
5470 ``using (Py.GIL()) {/* Your code here */} `` block.
5571- Import python modules using ``dynamic mod = Py.Import("mod") ``, then
0 commit comments