Skip to content

Adding more C# examples#12

Merged
filmor merged 2 commits into
pythonnet:masterfrom
jbw3:csharp-examples
Aug 21, 2018
Merged

Adding more C# examples#12
filmor merged 2 commits into
pythonnet:masterfrom
jbw3:csharp-examples

Conversation

@jbw3

@jbw3 jbw3 commented Aug 18, 2018

Copy link
Copy Markdown

Most of the examples show how to use a .NET library from Python. However, there are not many that show how to use Python in C#, so I've added several.

Comment thread README.md Outdated
to use Python:

```csharp
IntPtr gilState = PythonEngine.AcquireLock();

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.

We should not encourage this, the Py.GIL part should be enough.

Comment thread README.md Outdated

// create a Python variable "person"
PyDict locals = new PyDict();
locals["person"] = pyPerson;

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.

We have the PyScope interface to make this a bit easier.

@jbw3

jbw3 commented Aug 21, 2018

Copy link
Copy Markdown
Author

I have addressed the comments.

@filmor

filmor commented Aug 21, 2018

Copy link
Copy Markdown
Member

Great, thank you very much :)

@filmor filmor merged commit d304a5c into pythonnet:master Aug 21, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants