diff --git a/README.rst b/README.rst index f2907f43a..a8e651890 100644 --- a/README.rst +++ b/README.rst @@ -85,6 +85,9 @@ Example static void Main(string[] args) { + // The Python library can also be set with the `PYTHONNET_PYDLL` env var + // or dynamically with a library like https://github.com/losttech/WhichPython + Runtime.PythonDLL = "python38.dll"; PythonEngine.Initialize(); using (Py.GIL()) { diff --git a/doc/source/dotnet.rst b/doc/source/dotnet.rst index ed2b741a7..f657c1261 100644 --- a/doc/source/dotnet.rst +++ b/doc/source/dotnet.rst @@ -16,6 +16,8 @@ At a very high level, to embed Python in your application one will need to: - Reference ``Python.Runtime.dll`` (e.g. via a ``PackageReference``) +- Set the Python library the code should run with via the ``Runtime.PythonDLL`` + property or the ``PYTHONNET_PYDLL`` environment variable - Call ``PythonEngine.Initialize()`` to initialize Python - Call ``var mod = PyModule.Import(name)`` to import a module as ``mod``