FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Update documentation to reflect API changes by TheJanzap · Pull Request #2439 · pythonnet/pythonnet · GitHub

Repository navigation

Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension .rst  (2) All 1 file type selected
Viewed files
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Unified
Split
Hide whitespace
Diff view
Unified
Split
Hide whitespace
3 changes: 3 additions & 0 deletions README.rst
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
Expand Up @@ -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";

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

I really don't want to give people the idea that this is the way to go. Maybe we can point them toward (or include) https://github.com/losttech/WhichPython? Maybe give a note above to set the PYTHONNET_PYDLL environment variable?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Yeah, I wasn't really keen on this either, but I figured since this was one of the examples given in the paragraph above it that this would be at least acceptable.
I also thought about mentioning the env var, but I didn't want to clutter this example with a comment (at least not without the permisson of you guys)

PythonEngine.Initialize();
using (Py.GIL())
{
Expand Down
2 changes: 2 additions & 0 deletions doc/source/dotnet.rst
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
Expand Up @@ -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``

Expand Down

Back | FazBrowse Home | New Git URL