Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Adding more C# examples #12

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Aug 21, 2018
Merged

Adding more C# examples #12

merged 2 commits into from
Aug 21, 2018

Conversation

jbw3
Copy link

@jbw3 jbw3 commented Aug 18, 2018

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.

README.md Outdated
to use Python:

```csharp
IntPtr gilState = PythonEngine.AcquireLock();
Copy link
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.

README.md Outdated

// create a Python variable "person"
PyDict locals = new PyDict();
locals["person"] = pyPerson;
Copy link
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
Copy link
Author

jbw3 commented Aug 21, 2018

I have addressed the comments.

@filmor
Copy link
Member

filmor commented Aug 21, 2018

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