Skip to content

Add very simple example editor #1333

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

Closed
wants to merge 1 commit into from
Closed

Conversation

gpetrou
Copy link
Contributor

@gpetrou gpetrou commented Dec 19, 2020

What does this implement/fix? Explain your changes.

I am doing my first steps in Python .NET and I created a small editor project in order to test the library. Looking for information on how to redirect output to C# and interrupt execution, I saw that other people had the same questions. So, I thought of making this small contribution to get other people started with this library instead of looking for the same things as I did.

Does this close any currently open issues?

Any other comments?

Checklist

Check all those that are applicable and complete.

  • Make sure to include one or more tests for your change
  • If an enhancement PR, please create docs and at best an example
  • Add yourself to AUTHORS
  • Updated the CHANGELOG

@dnfadmin
Copy link

dnfadmin commented Dec 19, 2020

CLA assistant check
All CLA requirements met.

@gpetrou gpetrou force-pushed the Editor branch 4 times, most recently from 67474eb to 9889ff1 Compare December 19, 2020 14:57
@filmor
Copy link
Member

filmor commented Dec 20, 2020

Hi,

First, thank you for your contribution. To me, these really look like two separate PRs, one for the Interrupt function and one for the Editor example.

Regarding the Interrupt:

  1. This requires a test
  2. Strictly, the thread-id attribute is unsigned only for Python >= 3.7 and we still support 3.6
  3. Also, since the original type is long, the "correct" type is (U)IntPtr on everything but Windows
  4. (Not quite sure how far we have to go there compatibility-wise, the current implementation could be fine for the usual thread IDs)
  5. Maybe we should just expose the API function directly (i.e. RaiseInPythonThread on Exception objects or so) and make Interrupt use that

Regarding the Editor:

  1. Should be in its own PR
  2. Should not be in src/
    I didn't read the actual code yet, but a self-contained example like this is definitely a useful addition.

@lostmsu
Copy link
Member

lostmsu commented Dec 21, 2020

I'd say example of this size should have its own repo.

@gpetrou gpetrou changed the title Add very simple example editor and Interrupt method in Runtime Add very simple example editor Feb 13, 2021
@gpetrou gpetrou force-pushed the Editor branch 2 times, most recently from 171fa42 to e97ff8a Compare February 13, 2021 07:32
@gpetrou
Copy link
Contributor Author

gpetrou commented Feb 16, 2021

@filmor any thoughts on this now that the Interrupt PR was separated?

@lostmsu
Copy link
Member

lostmsu commented Feb 17, 2021

I'd say example of this size should have its own repo.

Copy link

@PACE100 PACE100 left a comment

Choose a reason for hiding this comment

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

First Time Coding

@lostmsu lostmsu closed this Dec 25, 2021
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.

5 participants