From spryify at gmail.com Wed May 11 17:44:56 2016 From: spryify at gmail.com (Saparya K) Date: Wed, 11 May 2016 14:44:56 -0700 Subject: [Python.NET] Embedding a Python interactive shell in a .NET application Message-ID: Hello PythonNet, I am looking to embed a Python interactive (REPL) shell in a .NET WinForms application. This C# application displays a graphical visualization of some data. Methods to manipulate the data in the C# application would be exposed via a Python API. The idea is to be able to interact with the data from the Python shell via the API, and thereby updating the graphical view. Ideally, the shell should support any valid Python syntax that is required to use the API. This would involve: 1. Querying a collection of data from the application via the Python API 2. Then manipulating this collection in the Python shell 3. Making API calls with the modified collection as an argument I came across a few examples where an interactive shell was developed using IronPython. A limitation with this approach is the absence of *Python 3.x* support (and other C-compiled libraries) in IronPython. For this reason, I would prefer to use Python.NET if it is possible. Has anyone here tried something like this with Python.NET before? Does it looks like what I am trying to achieve is feasible? Any direction would be very helpful! -------------- next part -------------- An HTML attachment was scrubbed... URL: From denis.akhiyarov at gmail.com Wed May 11 19:01:48 2016 From: denis.akhiyarov at gmail.com (Denis Akhiyarov) Date: Wed, 11 May 2016 18:01:48 -0500 Subject: [Python.NET] Embedding a Python interactive shell in a .NET application In-Reply-To: References: Message-ID: This is definitely possible with WinForms or WPF. See the demo folder in pythonnet repo. One of the demo's is still in pull request. You should probably just try running previous IronPython attempts using pythonnet and report issues if any. Have a look at Sho from Microsoft. There is someone trying to embed ipython REPL using pythonnet/Excel-DNA or COM in Excel with Custom Task Pane (CTP) written in WinForms: https://groups.google.com/forum/#!topic/jupyter/CVht4orvQtc On Wed, May 11, 2016 at 4:44 PM, Saparya K wrote: > Hello PythonNet, > > I am looking to embed a Python interactive (REPL) shell in a .NET > WinForms application. > This C# application displays a graphical visualization of some data. > Methods to manipulate the data in the C# application would be exposed via a > Python API. > The idea is to be able to interact with the data from the Python shell via > the API, and thereby updating the graphical view. > > Ideally, the shell should support any valid Python syntax that is required > to use the API. This would involve: > > 1. Querying a collection of data from the application via the Python > API > 2. Then manipulating this collection in the Python shell > 3. Making API calls with the modified collection as an argument > > I came across a few examples where an interactive shell was developed > using IronPython. A limitation with this approach is the absence of *Python > 3.x* support (and other C-compiled libraries) in IronPython. For this > reason, I would prefer to use Python.NET if it is possible. > > Has anyone here tried something like this with Python.NET before? Does it > looks like what I am trying to achieve is feasible? > > Any direction would be very helpful! > > _________________________________________________ > Python.NET mailing list - PythonDotNet at python.org > https://mail.python.org/mailman/listinfo/pythondotnet > -------------- next part -------------- An HTML attachment was scrubbed... URL: From spryify at gmail.com Thu May 12 17:16:05 2016 From: spryify at gmail.com (Saparya K) Date: Thu, 12 May 2016 14:16:05 -0700 Subject: [Python.NET] Embedding a Python interactive shell in a .NET application In-Reply-To: References: Message-ID: Thanks for your response, Denis. I had not come across Sho earlier. It looks very interesting. (If only Python 3.x support was available, though it does look like they have added support for their own math and visualization libraries). I am going over the demos and the unit tests and I was able to write a simple console application to access .NET objects from Python. This is very encouraging! I am still figuring out how to embed Python code in my C# WinForms application (instead of a console application). I will continue my experiments, but in the meantime if you or anyone else has any ideas on how to redirect the result from the Python interpreter (say, to a rich text box), I would love to hear them. That is one part of the puzzle that is unclear to me. Thanks, Saparya On Wed, May 11, 2016 at 4:01 PM, Denis Akhiyarov wrote: > This is definitely possible with WinForms or WPF. See the demo folder in > pythonnet repo. One of the demo's is still in pull request. > > You should probably just try running previous IronPython attempts using > pythonnet and report issues if any. Have a look at Sho from Microsoft. > > There is someone trying to embed ipython REPL using pythonnet/Excel-DNA or > COM in Excel with Custom Task Pane (CTP) written in WinForms: > > https://groups.google.com/forum/#!topic/jupyter/CVht4orvQtc > > > > > > On Wed, May 11, 2016 at 4:44 PM, Saparya K wrote: > >> Hello PythonNet, >> >> I am looking to embed a Python interactive (REPL) shell in a .NET >> WinForms application. >> This C# application displays a graphical visualization of some data. >> Methods to manipulate the data in the C# application would be exposed via a >> Python API. >> The idea is to be able to interact with the data from the Python shell >> via the API, and thereby updating the graphical view. >> >> Ideally, the shell should support any valid Python syntax that is >> required to use the API. This would involve: >> >> 1. Querying a collection of data from the application via the Python >> API >> 2. Then manipulating this collection in the Python shell >> 3. Making API calls with the modified collection as an argument >> >> I came across a few examples where an interactive shell was developed >> using IronPython. A limitation with this approach is the absence of *Python >> 3.x* support (and other C-compiled libraries) in IronPython. For this >> reason, I would prefer to use Python.NET if it is possible. >> >> Has anyone here tried something like this with Python.NET before? Does it >> looks like what I am trying to achieve is feasible? >> >> Any direction would be very helpful! >> >> _________________________________________________ >> Python.NET mailing list - PythonDotNet at python.org >> https://mail.python.org/mailman/listinfo/pythondotnet >> > > > _________________________________________________ > Python.NET mailing list - PythonDotNet at python.org > https://mail.python.org/mailman/listinfo/pythondotnet > -------------- next part -------------- An HTML attachment was scrubbed... URL: From denis.akhiyarov at gmail.com Fri May 13 16:04:15 2016 From: denis.akhiyarov at gmail.com (Denis Akhiyarov) Date: Fri, 13 May 2016 15:04:15 -0500 Subject: [Python.NET] Embedding a Python interactive shell in a .NET application In-Reply-To: References: Message-ID: for embedding look at c# embedding unit tests and also here: 1. Old API: http://pythonnet.github.io/readme.html 2. New simplified API using dynamic: https://github.com/pythonnet/pythonnet/blob/master/README.md On Thu, May 12, 2016 at 4:16 PM, Saparya K wrote: > Thanks for your response, Denis. > > I had not come across Sho earlier. It looks very interesting. (If only > Python 3.x support was available, though it does look like they have added > support for their own math and visualization libraries). > > I am going over the demos and the unit tests and I was able to write a > simple console application to access .NET objects from Python. This is very > encouraging! > I am still figuring out how to embed Python code in my C# WinForms > application (instead of a console application). > > I will continue my experiments, but in the meantime if you or anyone else > has any ideas on how to redirect the result from the Python interpreter > (say, to a rich text box), I would love to hear them. That is one part of > the puzzle that is unclear to me. > > Thanks, > Saparya > > On Wed, May 11, 2016 at 4:01 PM, Denis Akhiyarov < > denis.akhiyarov at gmail.com> wrote: > >> This is definitely possible with WinForms or WPF. See the demo folder in >> pythonnet repo. One of the demo's is still in pull request. >> >> You should probably just try running previous IronPython attempts using >> pythonnet and report issues if any. Have a look at Sho from Microsoft. >> >> There is someone trying to embed ipython REPL using pythonnet/Excel-DNA >> or COM in Excel with Custom Task Pane (CTP) written in WinForms: >> >> https://groups.google.com/forum/#!topic/jupyter/CVht4orvQtc >> >> >> >> >> >> On Wed, May 11, 2016 at 4:44 PM, Saparya K wrote: >> >>> Hello PythonNet, >>> >>> I am looking to embed a Python interactive (REPL) shell in a .NET >>> WinForms application. >>> This C# application displays a graphical visualization of some data. >>> Methods to manipulate the data in the C# application would be exposed via a >>> Python API. >>> The idea is to be able to interact with the data from the Python shell >>> via the API, and thereby updating the graphical view. >>> >>> Ideally, the shell should support any valid Python syntax that is >>> required to use the API. This would involve: >>> >>> 1. Querying a collection of data from the application via the Python >>> API >>> 2. Then manipulating this collection in the Python shell >>> 3. Making API calls with the modified collection as an argument >>> >>> I came across a few examples where an interactive shell was developed >>> using IronPython. A limitation with this approach is the absence of *Python >>> 3.x* support (and other C-compiled libraries) in IronPython. For this >>> reason, I would prefer to use Python.NET if it is possible. >>> >>> Has anyone here tried something like this with Python.NET before? Does >>> it looks like what I am trying to achieve is feasible? >>> >>> Any direction would be very helpful! >>> >>> _________________________________________________ >>> Python.NET mailing list - PythonDotNet at python.org >>> https://mail.python.org/mailman/listinfo/pythondotnet >>> >> >> >> _________________________________________________ >> Python.NET mailing list - PythonDotNet at python.org >> https://mail.python.org/mailman/listinfo/pythondotnet >> > > > _________________________________________________ > Python.NET mailing list - PythonDotNet at python.org > https://mail.python.org/mailman/listinfo/pythondotnet > -------------- next part -------------- An HTML attachment was scrubbed... URL: From nilsc.becker at gmail.com Tue May 17 06:33:24 2016 From: nilsc.becker at gmail.com (Nils Becker) Date: Tue, 17 May 2016 12:33:24 +0200 Subject: [Python.NET] Embedding a Python interactive shell in a .NET application In-Reply-To: References: Message-ID: Hey, a while ago I wrote something like a light wrapper around Python.NET to embed CPython with numpy/scipy in a .NET GUI. It manages local/global dictionaries, automatically converts simple data types and numpy arrrays<->C# arrays and provides a plotting widget in C# that shows matplotlib plots. It also has some other convenience functions. The code is by no means complete, fully tested or even nice. However, for me it works. I uploaded it to github: https://github.com/Lodomir/PythonInterface As it demonstrates some not-well documented use of Python.NET, I thought it maybe nice to share the code. You will need to add the references to Python.NET to build the main project (PythonInterface) and additionally to the PythonInterface-DLL to build the examples. Cheers Nils 2016-05-13 22:04 GMT+02:00 Denis Akhiyarov : > for embedding look at c# embedding unit tests and also here: > > 1. Old API: > > http://pythonnet.github.io/readme.html > > 2. New simplified API using dynamic: > > https://github.com/pythonnet/pythonnet/blob/master/README.md > > > > On Thu, May 12, 2016 at 4:16 PM, Saparya K wrote: > >> Thanks for your response, Denis. >> >> I had not come across Sho earlier. It looks very interesting. (If only >> Python 3.x support was available, though it does look like they have added >> support for their own math and visualization libraries). >> >> I am going over the demos and the unit tests and I was able to write a >> simple console application to access .NET objects from Python. This is very >> encouraging! >> I am still figuring out how to embed Python code in my C# WinForms >> application (instead of a console application). >> >> I will continue my experiments, but in the meantime if you or anyone else >> has any ideas on how to redirect the result from the Python interpreter >> (say, to a rich text box), I would love to hear them. That is one part of >> the puzzle that is unclear to me. >> >> Thanks, >> Saparya >> >> On Wed, May 11, 2016 at 4:01 PM, Denis Akhiyarov < >> denis.akhiyarov at gmail.com> wrote: >> >>> This is definitely possible with WinForms or WPF. See the demo folder in >>> pythonnet repo. One of the demo's is still in pull request. >>> >>> You should probably just try running previous IronPython attempts using >>> pythonnet and report issues if any. Have a look at Sho from Microsoft. >>> >>> There is someone trying to embed ipython REPL using pythonnet/Excel-DNA >>> or COM in Excel with Custom Task Pane (CTP) written in WinForms: >>> >>> https://groups.google.com/forum/#!topic/jupyter/CVht4orvQtc >>> >>> >>> >>> >>> >>> On Wed, May 11, 2016 at 4:44 PM, Saparya K wrote: >>> >>>> Hello PythonNet, >>>> >>>> I am looking to embed a Python interactive (REPL) shell in a .NET >>>> WinForms application. >>>> This C# application displays a graphical visualization of some data. >>>> Methods to manipulate the data in the C# application would be exposed via a >>>> Python API. >>>> The idea is to be able to interact with the data from the Python shell >>>> via the API, and thereby updating the graphical view. >>>> >>>> Ideally, the shell should support any valid Python syntax that is >>>> required to use the API. This would involve: >>>> >>>> 1. Querying a collection of data from the application via the >>>> Python API >>>> 2. Then manipulating this collection in the Python shell >>>> 3. Making API calls with the modified collection as an argument >>>> >>>> I came across a few examples where an interactive shell was developed >>>> using IronPython. A limitation with this approach is the absence of *Python >>>> 3.x* support (and other C-compiled libraries) in IronPython. For this >>>> reason, I would prefer to use Python.NET if it is possible. >>>> >>>> Has anyone here tried something like this with Python.NET before? Does >>>> it looks like what I am trying to achieve is feasible? >>>> >>>> Any direction would be very helpful! >>>> >>>> _________________________________________________ >>>> Python.NET mailing list - PythonDotNet at python.org >>>> https://mail.python.org/mailman/listinfo/pythondotnet >>>> >>> >>> >>> _________________________________________________ >>> Python.NET mailing list - PythonDotNet at python.org >>> https://mail.python.org/mailman/listinfo/pythondotnet >>> >> >> >> _________________________________________________ >> Python.NET mailing list - PythonDotNet at python.org >> https://mail.python.org/mailman/listinfo/pythondotnet >> > > > _________________________________________________ > Python.NET mailing list - PythonDotNet at python.org > https://mail.python.org/mailman/listinfo/pythondotnet > -------------- next part -------------- An HTML attachment was scrubbed... URL: From spryify at gmail.com Wed May 18 03:02:06 2016 From: spryify at gmail.com (Saparya K) Date: Wed, 18 May 2016 00:02:06 -0700 Subject: [Python.NET] Embedding a Python interactive shell in a .NET application In-Reply-To: References: Message-ID: Hi Denis, Thanks for pointing me to the new API. I am now able to embed Python in my C# code and access Python classes and methods from C#! Hi Nils, Your application looks very interesting and some of the features (e.g. matplotlib integration) are on the lines of what I have been thinking about. I am far from there though and will need to learn more before I can follow all the code in your wrapper! ----- As of now, I am trying to redirect the output from the Python interpreter to a .NET text box. While I am able to redirect the output to a file, I am having trouble with routing the output to a text box. I first tried to redirect the console output to a custom TextWriter using Console.SetOut in C#: private void Form1_Load(object sender, EventArgs e) { _writer = new TextBoxWriter(this.textBox1); Console.SetOut(_writer); // Redirect stdout to custom TextWriter that writes to the text box } This did not work: while output from C# is routed to the text box, output from Python is not. ----- I then thought that maybe I need to redirect the Python stdout instead of the C# standard output. The idea was to assign Python's sys.stdout to a .NET object that implements the same interface as a python stream (write(), writelines()...): *.NET class to mimic Python stream:* 1. public class TextBoxStream : PyObject // To assign to sys.stdout. Is this correct?{ private TextBox _output = null; public TextBoxStream() {} public TextBoxStream(TextBox output) { _output = output; } void write(object value) { _output.AppendText(value.ToString()); }} *In Form1.cs:* private void button1_Click(object sender, EventArgs e) { using (Py.GIL()) { // Redirect stdout to text box dynamic sys = PythonEngine.ImportModule("sys"); TextBoxStream textBoxStream = new TextBoxStream(textBox1); sys.stdout = textBoxStream; // This is probably not theright way? //sys.SetAttr("stdout", textBoxStream); // This did not work either string code = "import sys\n" + "print 'Message 1'\n" + "sys.stdout.write('Message 2')\n" + "sys.stdout.flush()"; PyObject redirectPyObj = PythonEngine.RunString(code); // returns NULL sys.stdout.write("Message 3"); // Exception thrown: 'Python.Runtime.PyObject' does not contain a definition for 'stdout' }} This does not work either: redirectPyObj is NULL. I tried using the old as well as the new Python.NET API (with dynamic). Neither the sys.stdout.write nor the print statements write to the text box. Any ideas on how to approach this would be very helpful. Thanks, Saparya On Tue, May 17, 2016 at 3:33 AM, Nils Becker wrote: > Hey, > > a while ago I wrote something like a light wrapper around Python.NET to > embed CPython with numpy/scipy in a .NET GUI. It manages local/global > dictionaries, automatically converts simple data types and numpy > arrrays<->C# arrays and provides a plotting widget in C# that shows > matplotlib plots. It also has some other convenience functions. > > The code is by no means complete, fully tested or even nice. However, for > me it works. > > I uploaded it to github: https://github.com/Lodomir/PythonInterface > As it demonstrates some not-well documented use of Python.NET, I thought > it maybe nice to share the code. > > You will need to add the references to Python.NET to build the main > project (PythonInterface) and additionally to the PythonInterface-DLL to > build the examples. > > Cheers > Nils > > 2016-05-13 22:04 GMT+02:00 Denis Akhiyarov : > >> for embedding look at c# embedding unit tests and also here: >> >> 1. Old API: >> >> http://pythonnet.github.io/readme.html >> >> 2. New simplified API using dynamic: >> >> https://github.com/pythonnet/pythonnet/blob/master/README.md >> >> >> >> On Thu, May 12, 2016 at 4:16 PM, Saparya K wrote: >> >>> Thanks for your response, Denis. >>> >>> I had not come across Sho earlier. It looks very interesting. (If only >>> Python 3.x support was available, though it does look like they have added >>> support for their own math and visualization libraries). >>> >>> I am going over the demos and the unit tests and I was able to write a >>> simple console application to access .NET objects from Python. This is very >>> encouraging! >>> I am still figuring out how to embed Python code in my C# WinForms >>> application (instead of a console application). >>> >>> I will continue my experiments, but in the meantime if you or anyone >>> else has any ideas on how to redirect the result from the Python >>> interpreter (say, to a rich text box), I would love to hear them. That is >>> one part of the puzzle that is unclear to me. >>> >>> Thanks, >>> Saparya >>> >>> On Wed, May 11, 2016 at 4:01 PM, Denis Akhiyarov < >>> denis.akhiyarov at gmail.com> wrote: >>> >>>> This is definitely possible with WinForms or WPF. See the demo folder >>>> in pythonnet repo. One of the demo's is still in pull request. >>>> >>>> You should probably just try running previous IronPython attempts using >>>> pythonnet and report issues if any. Have a look at Sho from Microsoft. >>>> >>>> There is someone trying to embed ipython REPL using pythonnet/Excel-DNA >>>> or COM in Excel with Custom Task Pane (CTP) written in WinForms: >>>> >>>> https://groups.google.com/forum/#!topic/jupyter/CVht4orvQtc >>>> >>>> >>>> >>>> >>>> >>>> On Wed, May 11, 2016 at 4:44 PM, Saparya K wrote: >>>> >>>>> Hello PythonNet, >>>>> >>>>> I am looking to embed a Python interactive (REPL) shell in a .NET >>>>> WinForms application. >>>>> This C# application displays a graphical visualization of some data. >>>>> Methods to manipulate the data in the C# application would be exposed via a >>>>> Python API. >>>>> The idea is to be able to interact with the data from the Python shell >>>>> via the API, and thereby updating the graphical view. >>>>> >>>>> Ideally, the shell should support any valid Python syntax that is >>>>> required to use the API. This would involve: >>>>> >>>>> 1. Querying a collection of data from the application via the >>>>> Python API >>>>> 2. Then manipulating this collection in the Python shell >>>>> 3. Making API calls with the modified collection as an argument >>>>> >>>>> I came across a few examples where an interactive shell was developed >>>>> using IronPython. A limitation with this approach is the absence of *Python >>>>> 3.x* support (and other C-compiled libraries) in IronPython. For this >>>>> reason, I would prefer to use Python.NET if it is possible. >>>>> >>>>> Has anyone here tried something like this with Python.NET before? Does >>>>> it looks like what I am trying to achieve is feasible? >>>>> >>>>> Any direction would be very helpful! >>>>> >>>>> _________________________________________________ >>>>> Python.NET mailing list - PythonDotNet at python.org >>>>> https://mail.python.org/mailman/listinfo/pythondotnet >>>>> >>>> >>>> >>>> _________________________________________________ >>>> Python.NET mailing list - PythonDotNet at python.org >>>> https://mail.python.org/mailman/listinfo/pythondotnet >>>> >>> >>> >>> _________________________________________________ >>> Python.NET mailing list - PythonDotNet at python.org >>> https://mail.python.org/mailman/listinfo/pythondotnet >>> >> >> >> _________________________________________________ >> Python.NET mailing list - PythonDotNet at python.org >> https://mail.python.org/mailman/listinfo/pythondotnet >> > > > _________________________________________________ > Python.NET mailing list - PythonDotNet at python.org > https://mail.python.org/mailman/listinfo/pythondotnet > -------------- next part -------------- An HTML attachment was scrubbed... URL: From HMoeller at comprion.com Wed May 25 08:33:11 2016 From: HMoeller at comprion.com (Henning Moeller) Date: Wed, 25 May 2016 12:33:11 +0000 Subject: [Python.NET] Explicitly implemented interface methods Message-ID: <202470c362974c20a94fc96c084d08ae@ex2013.orga-test.local> Hello out there, I've come across an issue with calling a method of an instance which ends up being an explicitly implemented interface method. Let me explain with a very brief example: Consider this a very basic interface: [File: ISomeInterface.cs] namespace PythonInterfaceCalls { public interface ISomeInterface { void ImplicitImplementation(); void ExplicitImplementation(); } } And here's an implementing class. Note one of the methods being implicitly implemented, the other being explicitly implemented: [File: SomeImplementation.cs] using System; namespace PythonInterfaceCalls { public class SomeImplementation: ISomeInterface { public void ImplicitImplementation() { Console.WriteLine("Call of implicitly implemented interface method."); } void ISomeInterface.ExplicitImplementation() { Console.WriteLine("Call of explicitly implemented interface method."); } } } Note the method headers. While the implicit implementation is (and has to be) public, the explicit implementation is (and has to be) internal. Both methods work well in C# (as long as the instance is casted into the interface type). See the unit tests, both passing: [File: TestImplementation.cs] using System; using System.IO; using NUnit.Framework; namespace PythonInterfaceCalls { [TestFixture] public class TestImplementation { [Test] public void TestImplicitCall() { var implementation = new SomeImplementation() as ISomeInterface; using (StringWriter sw = new StringWriter()) { Console.SetOut(sw); implementation.ImplicitImplementation(); Assert.AreEqual("Call of implicitly implemented interface method.\r\n", sw.ToString()); } } [Test] public void TestExplicitCall() { var implementation = new SomeImplementation() as ISomeInterface; using (StringWriter sw = new StringWriter()) { Console.SetOut(sw); implementation.ExplicitImplementation(); Assert.AreEqual("Call of explicitly implemented interface method.\r\n", sw.ToString()); } } } } This should be solvable using the following method to access all interface members, not just the publicly available ones: [File: InterfaceMembersExtension.cs] using System; using System.Collections.Generic; using System.Reflection; namespace PythonInterfaceCalls { public static class InterfaceMembersExtension { public static IList GetImplementedMethods(this Type targetType, Type interfaceType) { return targetType.GetInterfaceMap(interfaceType).TargetMethods; } } } Please find the complete solution attached to this mail. Is there a chance that this will be implemented in PythonNet? Thanks in advance, Hennnig -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: PythonInterfaceCalls.zip Type: application/x-zip-compressed Size: 55933 bytes Desc: PythonInterfaceCalls.zip URL: From tony at pyxll.com Wed May 25 09:59:09 2016 From: tony at pyxll.com (Tony Roberts) Date: Wed, 25 May 2016 14:59:09 +0100 Subject: [Python.NET] Explicitly implemented interface methods In-Reply-To: <202470c362974c20a94fc96c084d08ae@ex2013.orga-test.local> References: <202470c362974c20a94fc96c084d08ae@ex2013.orga-test.local> Message-ID: Hi Henning, the best way to get a change or fix into the pythonnet is to submit it as a pull request to the github repo, along with a description of the problem the PR solves and appropriate unit tests. The github repo can be found here: https://github.com/pythonnet/pythonnet Kind regards, Tony -------------- next part -------------- An HTML attachment was scrubbed... URL: From denis.akhiyarov at gmail.com Wed May 25 11:08:57 2016 From: denis.akhiyarov at gmail.com (Denis Akhiyarov) Date: Wed, 25 May 2016 10:08:57 -0500 Subject: [Python.NET] Explicitly implemented interface methods In-Reply-To: <202470c362974c20a94fc96c084d08ae@ex2013.orga-test.local> References: <202470c362974c20a94fc96c084d08ae@ex2013.orga-test.local> Message-ID: Please open an issue or two in github :) But I looked through the code and do not see any python or pythonnet calls. Can you describe the problem from the pythonnet side? Did you find that explicit interfaces do not work? Anyway, I learned something new today. On Wed, May 25, 2016 at 7:33 AM, Henning Moeller wrote: > Hello out there, > > > > I?ve come across an issue with calling a method of an instance which ends > up being an explicitly implemented interface method. Let me explain with a > very brief example: > > > > Consider this a very basic interface: > > > > [File: ISomeInterface.cs] > > namespace PythonInterfaceCalls > > { > > public interface ISomeInterface > > { > > void ImplicitImplementation(); > > void ExplicitImplementation(); > > } > > } > > > > And here?s an implementing class. Note one of the methods being implicitly > implemented, the other being explicitly implemented: > > > > [File: SomeImplementation.cs] > > using System; > > > > namespace PythonInterfaceCalls > > { > > public class SomeImplementation: ISomeInterface > > { > > public void ImplicitImplementation() > > { > > Console.WriteLine("Call of implicitly implemented interface > method."); > > } > > > > void ISomeInterface.ExplicitImplementation() > > { > > Console.WriteLine("Call of explicitly implemented interface > method."); > > } > > } > > } > > > > Note the method headers. While the implicit implementation is (and has to > be) public, the explicit implementation is (and has to be) internal. Both > methods work well in C# (as long as the instance is casted into the > interface type). See the unit tests, both passing: > > > > [File: TestImplementation.cs] > > using System; > > using System.IO; > > using NUnit.Framework; > > > > namespace PythonInterfaceCalls > > { > > [TestFixture] > > public class TestImplementation > > { > > [Test] > > public void TestImplicitCall() > > { > > var implementation = new SomeImplementation() as > ISomeInterface; > > using (StringWriter sw = new StringWriter()) > > { > > Console.SetOut(sw); > > implementation.ImplicitImplementation(); > > Assert.AreEqual("Call of implicitly implemented interface > method.\r\n", sw.ToString()); > > } > > } > > > > [Test] > > public void TestExplicitCall() > > { > > var implementation = new SomeImplementation() as > ISomeInterface; > > using (StringWriter sw = new StringWriter()) > > { > > Console.SetOut(sw); > > implementation.ExplicitImplementation(); > > Assert.AreEqual("Call of explicitly implemented interface > method.\r\n", sw.ToString()); > > } > > } > > } > > } > > > > This should be solvable using the following method to access all interface > members, not just the publicly available ones: > > > > [File: InterfaceMembersExtension.cs] > > using System; > > using System.Collections.Generic; > > using System.Reflection; > > > > namespace PythonInterfaceCalls > > { > > public static class InterfaceMembersExtension > > { > > public static IList GetImplementedMethods(this Type > targetType, Type interfaceType) > > { > > return > targetType.GetInterfaceMap(interfaceType).TargetMethods; > > } > > } > > } > > > > Please find the complete solution attached to this mail. > > > > Is there a chance that this will be implemented in PythonNet? > > > > Thanks in advance, > > > > Hennnig > > > > _________________________________________________ > Python.NET mailing list - PythonDotNet at python.org > https://mail.python.org/mailman/listinfo/pythondotnet > -------------- next part -------------- An HTML attachment was scrubbed... URL: From HMoeller at comprion.com Wed May 25 11:57:27 2016 From: HMoeller at comprion.com (Henning Moeller) Date: Wed, 25 May 2016 15:57:27 +0000 Subject: [Python.NET] Explicitly implemented interface methods In-Reply-To: References: <202470c362974c20a94fc96c084d08ae@ex2013.orga-test.local> Message-ID: <011DF2B6-5148-4F04-84AD-F605E7F790ED@comprion.com> Hi Tony, This is not a solution for the change but only an idea. I don?t know the concept of PythonNet well enough to figure out where to add the proposed change. And I don?t have a proper development environment to integrate and test the change. That?s why I try to advertise it in the mailing list. I?d be ready to contribute, though. Could you point me to resources on how to debug the Python.Runtime.dll? Best regards, Henning -------------- next part -------------- An HTML attachment was scrubbed... URL: From denis.akhiyarov at gmail.com Thu May 26 00:39:23 2016 From: denis.akhiyarov at gmail.com (Denis Akhiyarov) Date: Wed, 25 May 2016 23:39:23 -0500 Subject: [Python.NET] Interesting 2015 video from long-time pythonnet user at JP Morgan Chase Message-ID: Today I stumbled upon an interesting video from last year by Maksim Kozyarchuk, who is Director at JPMorgan Chase & Co. in New York. He is long-time pythonnet user - as early as 2006! https://mail.python.org/pipermail/pythondotnet/2006-August/000544.html He described how they built WPF GUI applications using pythonnet. https://www.youtube.com/watch?v=0xfLo7PpKPc http://pyvideo.org/video/3774/writing-winforms-and-wpf-applications-in-python You can follow his blog at http://kozyarchuk.blogspot.com/ -- Denis -------------- next part -------------- An HTML attachment was scrubbed... URL: From spryify at gmail.com Fri May 27 17:40:59 2016 From: spryify at gmail.com (Saparya K) Date: Fri, 27 May 2016 14:40:59 -0700 Subject: [Python.NET] Embedding a Python interactive shell in a .NET application In-Reply-To: References: Message-ID: Just in case someone stumbles on this post looking for an answer: A solution that worked for me was redirecting the Python stdout/stderr to a stream in Python. I was then able to route this stream into the .NET text box. private void button1_Click(object sender, EventArgs e){ using (Py.GIL()) { // Redirect stdout to text box dynamic sys = PythonEngine.ImportModule("sys"); string codeToRedirectOutput = "import sys\n" + "from io import StringIO\n" + "sys.stdout = mystdout = StringIO()\n" + "sys.stdout.flush()\n" + "sys.stderr = mystderr = StringIO()\n" + "sys.stderr.flush()\n"; PythonEngine.RunString(codeToRedirectOutput); // Run Python code string pyCode = "print(1 + 2)"; PyObject result = PythonEngine.RunString(pyCode); // null in case of error if (result != null) { string pyStdout = sys.stdout.getvalue(); // Get stdout pyStdout = pyStdout.Replace("\n", "\r\n"); // To support newline for textbox textBox1.Text = pyStdout; } else { PythonEngine.PrintError(); // Make Python engine print errors string pyStderr = sys.stderr.getvalue(); // Get stderr pyStderr = pyStderr.Replace("\n", "\r\n"); // To support newline for textbox textBox1.Text = pyStderr; } }} With this code, I was able to redirect the stdout (and stderr in the case of an error) from the Python engine to a .NET text box. On Wed, May 18, 2016 at 12:02 AM, Saparya K wrote: > Hi Denis, > Thanks for pointing me to the new API. I am now able to embed Python in my > C# code and access Python classes and methods from C#! > > Hi Nils, > Your application looks very interesting and some of the features (e.g. > matplotlib integration) are on the lines of what I have been thinking > about. I am far from there though and will need to learn more before I can > follow all the code in your wrapper! > > ----- > > As of now, I am trying to redirect the output from the Python interpreter > to a .NET text box. While I am able to redirect the output to a file, I am > having trouble with routing the output to a text box. > > I first tried to redirect the console output to a custom TextWriter using > Console.SetOut in C#: > > private void Form1_Load(object sender, EventArgs e) > { > _writer = new TextBoxWriter(this.textBox1); > Console.SetOut(_writer); // Redirect stdout to custom TextWriter > that writes to the text box > } > > This did not work: while output from C# is routed to the text box, output > from Python is not. > > ----- > > I then thought that maybe I need to redirect the Python stdout instead of > the C# standard output. The idea was to assign Python's sys.stdout to a > .NET object that implements the same interface as a python stream (write(), > writelines()...): > > *.NET class to mimic Python stream:* > > 1. > > public class TextBoxStream : PyObject // To assign to sys.stdout. Is this correct?{ > private TextBox _output = null; > > public TextBoxStream() {} > > public TextBoxStream(TextBox output) { > _output = output; > } > > void write(object value) { > _output.AppendText(value.ToString()); > }} > > *In Form1.cs:* > > private void button1_Click(object sender, EventArgs e) { > using (Py.GIL()) > { > // Redirect stdout to text box > dynamic sys = PythonEngine.ImportModule("sys"); > TextBoxStream textBoxStream = new TextBoxStream(textBox1); > sys.stdout = textBoxStream; // This is probably not theright way? > //sys.SetAttr("stdout", textBoxStream); // This did not work either > > string code = > "import sys\n" + > "print 'Message 1'\n" + > "sys.stdout.write('Message 2')\n" + > "sys.stdout.flush()"; > > PyObject redirectPyObj = PythonEngine.RunString(code); // returns NULL > sys.stdout.write("Message 3"); > // Exception thrown: 'Python.Runtime.PyObject' does not contain a definition for 'stdout' > }} > > > This does not work either: redirectPyObj is NULL. I tried using the old as > well as the new Python.NET API (with dynamic). Neither the sys.stdout.write > nor the print statements write to the text box. > > Any ideas on how to approach this would be very helpful. > Thanks, > Saparya > > > On Tue, May 17, 2016 at 3:33 AM, Nils Becker > wrote: > >> Hey, >> >> a while ago I wrote something like a light wrapper around Python.NET to >> embed CPython with numpy/scipy in a .NET GUI. It manages local/global >> dictionaries, automatically converts simple data types and numpy >> arrrays<->C# arrays and provides a plotting widget in C# that shows >> matplotlib plots. It also has some other convenience functions. >> >> The code is by no means complete, fully tested or even nice. However, for >> me it works. >> >> I uploaded it to github: https://github.com/Lodomir/PythonInterface >> As it demonstrates some not-well documented use of Python.NET, I thought >> it maybe nice to share the code. >> >> You will need to add the references to Python.NET to build the main >> project (PythonInterface) and additionally to the PythonInterface-DLL to >> build the examples. >> >> Cheers >> Nils >> >> 2016-05-13 22:04 GMT+02:00 Denis Akhiyarov : >> >>> for embedding look at c# embedding unit tests and also here: >>> >>> 1. Old API: >>> >>> http://pythonnet.github.io/readme.html >>> >>> 2. New simplified API using dynamic: >>> >>> https://github.com/pythonnet/pythonnet/blob/master/README.md >>> >>> >>> >>> On Thu, May 12, 2016 at 4:16 PM, Saparya K wrote: >>> >>>> Thanks for your response, Denis. >>>> >>>> I had not come across Sho earlier. It looks very interesting. (If only >>>> Python 3.x support was available, though it does look like they have added >>>> support for their own math and visualization libraries). >>>> >>>> I am going over the demos and the unit tests and I was able to write a >>>> simple console application to access .NET objects from Python. This is very >>>> encouraging! >>>> I am still figuring out how to embed Python code in my C# WinForms >>>> application (instead of a console application). >>>> >>>> I will continue my experiments, but in the meantime if you or anyone >>>> else has any ideas on how to redirect the result from the Python >>>> interpreter (say, to a rich text box), I would love to hear them. That is >>>> one part of the puzzle that is unclear to me. >>>> >>>> Thanks, >>>> Saparya >>>> >>>> On Wed, May 11, 2016 at 4:01 PM, Denis Akhiyarov < >>>> denis.akhiyarov at gmail.com> wrote: >>>> >>>>> This is definitely possible with WinForms or WPF. See the demo folder >>>>> in pythonnet repo. One of the demo's is still in pull request. >>>>> >>>>> You should probably just try running previous IronPython attempts >>>>> using pythonnet and report issues if any. Have a look at Sho from Microsoft. >>>>> >>>>> There is someone trying to embed ipython REPL using >>>>> pythonnet/Excel-DNA or COM in Excel with Custom Task Pane (CTP) written >>>>> in WinForms: >>>>> >>>>> https://groups.google.com/forum/#!topic/jupyter/CVht4orvQtc >>>>> >>>>> >>>>> >>>>> >>>>> >>>>> On Wed, May 11, 2016 at 4:44 PM, Saparya K wrote: >>>>> >>>>>> Hello PythonNet, >>>>>> >>>>>> I am looking to embed a Python interactive (REPL) shell in a .NET >>>>>> WinForms application. >>>>>> This C# application displays a graphical visualization of some data. >>>>>> Methods to manipulate the data in the C# application would be exposed via a >>>>>> Python API. >>>>>> The idea is to be able to interact with the data from the Python >>>>>> shell via the API, and thereby updating the graphical view. >>>>>> >>>>>> Ideally, the shell should support any valid Python syntax that is >>>>>> required to use the API. This would involve: >>>>>> >>>>>> 1. Querying a collection of data from the application via the >>>>>> Python API >>>>>> 2. Then manipulating this collection in the Python shell >>>>>> 3. Making API calls with the modified collection as an argument >>>>>> >>>>>> I came across a few examples where an interactive shell was developed >>>>>> using IronPython. A limitation with this approach is the absence of *Python >>>>>> 3.x* support (and other C-compiled libraries) in IronPython. For >>>>>> this reason, I would prefer to use Python.NET if it is possible. >>>>>> >>>>>> Has anyone here tried something like this with Python.NET before? >>>>>> Does it looks like what I am trying to achieve is feasible? >>>>>> >>>>>> Any direction would be very helpful! >>>>>> >>>>>> _________________________________________________ >>>>>> Python.NET mailing list - PythonDotNet at python.org >>>>>> https://mail.python.org/mailman/listinfo/pythondotnet >>>>>> >>>>> >>>>> >>>>> _________________________________________________ >>>>> Python.NET mailing list - PythonDotNet at python.org >>>>> https://mail.python.org/mailman/listinfo/pythondotnet >>>>> >>>> >>>> >>>> _________________________________________________ >>>> Python.NET mailing list - PythonDotNet at python.org >>>> https://mail.python.org/mailman/listinfo/pythondotnet >>>> >>> >>> >>> _________________________________________________ >>> Python.NET mailing list - PythonDotNet at python.org >>> https://mail.python.org/mailman/listinfo/pythondotnet >>> >> >> >> _________________________________________________ >> Python.NET mailing list - PythonDotNet at python.org >> https://mail.python.org/mailman/listinfo/pythondotnet >> > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From cameron.hayne at introspect.ca Fri May 27 18:15:40 2016 From: cameron.hayne at introspect.ca (Cameron Hayne) Date: Fri, 27 May 2016 18:15:40 -0400 Subject: [Python.NET] Embedding a Python interactive shell in a .NET application In-Reply-To: References: Message-ID: I?m using a similar method for redirecting Python output to a .NET textBox: #---------------------------------------------------------- public static void redirectPythonOutput(TextWriter writer) { Output output = new Output(writer); using (Py.GIL()) { dynamic sys = Py.Import("sys"); sys.stdout = output; sys.stderr = output; } } #---------------------------------------------------------- where ?Output? is my own .NET class that implements the method expected of a Python file object: #---------------------------------------------------------- public class Output { private TextWriter myWriter = null; // ctor public Output(TextWriter writer) { myWriter = writer; } public void write(String str) { str = str.Replace("\n", Environment.NewLine); if (myWriter != null) { myWriter.Write(str); } else { Console.Write(str); } } public void writelines(String[] str) { foreach (String line in str) { if (myWriter != null) { myWriter.Write(str); } else { Console.Write(str); } } } public void flush() { if (myWriter != null) { myWriter.Flush(); } } public void close() { if (myWriter != null) { myWriter.Close(); } } } #---------------------------------------------------------- and I pass an instance of my TextBoxStreamWriter class to the constructor of Output: #---------------------------------------------------------- public class TextBoxStreamWriter : TextWriter { TextBox myTextBox = null; // ctor public TextBoxStreamWriter(TextBox textBox) { myTextBox = textBox; } // TODO: isn't this inefficient? Should we supply a method to write a string? public override void Write(char value) { base.Write(value); MethodInvoker action = delegate { myTextBox.AppendText(value.ToString()); }; myTextBox.BeginInvoke(action); } public override System.Text.Encoding Encoding { get { return System.Text.Encoding.UTF8; } } } #---------------------------------------------------------- On May 27, 2016, at 5:40 PM, Saparya K wrote: > Just in case someone stumbles on this post looking for an answer: > > A solution that worked for me was redirecting the Python stdout/stderr to a stream in Python. I was then able to route this stream into the .NET text box. > > private void button1_Click(object sender, EventArgs e) > { > using > (Py.GIL()) > { > // Redirect stdout to text box > dynamic sys = PythonEngine.ImportModule("sys"); > > string codeToRedirectOutput = > "import sys\n" + > "from io import StringIO\n" + > "sys.stdout = mystdout = StringIO()\n" + > "sys.stdout.flush()\n" + > "sys.stderr = mystderr = StringIO()\n" + > "sys.stderr.flush()\n"; > > PythonEngine.RunString(codeToRedirectOutput); > > > // Run Python code > string pyCode = "print(1 + 2)"; > PyObject result = PythonEngine.RunString(pyCode); // null in case of error > if (result != null) > { > string pyStdout = sys.stdout.getvalue(); // Get stdout > pyStdout > = pyStdout.Replace("\n", "\r\n"); // To support newline for textbox > textBox1 > .Text = pyStdout; > } > else > { > PythonEngine.PrintError(); // Make Python engine print errors > string pyStderr = sys.stderr.getvalue(); // Get stderr > pyStderr = pyStderr.Replace("\n", "\r\n"); // To support newline for textbox > > textBox1.Text = pyStderr; > } > } > } > With this code, I was able to redirect the stdout (and stderr in the case of an error) from the Python engine to a .NET text box. > > > On Wed, May 18, 2016 at 12:02 AM, Saparya K wrote: > Hi Denis, > Thanks for pointing me to the new API. I am now able to embed Python in my C# code and access Python classes and methods from C#! > > Hi Nils, > Your application looks very interesting and some of the features (e.g. matplotlib integration) are on the lines of what I have been thinking about. I am far from there though and will need to learn more before I can follow all the code in your wrapper! > > ----- > > As of now, I am trying to redirect the output from the Python interpreter to a .NET text box. While I am able to redirect the output to a file, I am having trouble with routing the output to a text box. > > I first tried to redirect the console output to a custom TextWriter using Console.SetOut in C#: > > private void Form1_Load(object sender, EventArgs e) > { > _writer = new TextBoxWriter(this.textBox1); > Console.SetOut(_writer); // Redirect stdout to custom TextWriter that writes to the text box > } > > This did not work: while output from C# is routed to the text box, output from Python is not. > > ----- > > I then thought that maybe I need to redirect the Python stdout instead of the C# standard output. The idea was to assign Python's sys.stdout to a .NET object that implements the same interface as a python stream (write(), writelines()...): > > .NET class to mimic Python stream: > ? public class TextBoxStream : PyObject // To assign to sys.stdout. Is this correct? > { > > > private TextBox _output = null; > > > > public TextBoxStream() {} > > > > public TextBoxStream(TextBox output) { > > _output > = output; > > > } > > > > void write(object value) { > > _output > .AppendText(value.ToString()); > > } > > } > In Form1.cs: > private void button1_Click(object sender, EventArgs e) { > > using > (Py.GIL()) > > > { > > > // Redirect stdout to text box > > > dynamic sys = PythonEngine.ImportModule("sys"); > > > TextBoxStream textBoxStream = new TextBoxStream(textBox1); > > sys > .stdout = textBoxStream; // This is probably not theright way? > > > //sys.SetAttr("stdout", textBoxStream); // This did not work either > > > > string code = > > > "import sys\n" + > > > "print 'Message 1'\n" + > > > "sys.stdout.write('Message 2')\n" + > > > "sys.stdout.flush()"; > > > > PyObject redirectPyObj = PythonEngine.RunString(code); // returns NULL > > sys > .stdout.write("Message 3"); > > > // Exception thrown: 'Python.Runtime.PyObject' does not contain a definition for 'stdout' > > > } > } > This does not work either: redirectPyObj is NULL. I tried using the old as well as the new Python.NET API (with dynamic). Neither the sys.stdout.write nor the print statements write to the text box. > > Any ideas on how to approach this would be very helpful. > > Thanks, > Saparya > > > On Tue, May 17, 2016 at 3:33 AM, Nils Becker wrote: > Hey, > > a while ago I wrote something like a light wrapper around Python.NET to embed CPython with numpy/scipy in a .NET GUI. It manages local/global dictionaries, automatically converts simple data types and numpy arrrays<->C# arrays and provides a plotting widget in C# that shows matplotlib plots. It also has some other convenience functions. > > The code is by no means complete, fully tested or even nice. However, for me it works. > > I uploaded it to github: https://github.com/Lodomir/PythonInterface > As it demonstrates some not-well documented use of Python.NET, I thought it maybe nice to share the code. > > You will need to add the references to Python.NET to build the main project (PythonInterface) and additionally to the PythonInterface-DLL to build the examples. > > Cheers > Nils > > 2016-05-13 22:04 GMT+02:00 Denis Akhiyarov : > for embedding look at c# embedding unit tests and also here: > > 1. Old API: > > http://pythonnet.github.io/readme.html > > 2. New simplified API using dynamic: > > https://github.com/pythonnet/pythonnet/blob/master/README.md > > > > On Thu, May 12, 2016 at 4:16 PM, Saparya K wrote: > Thanks for your response, Denis. > > I had not come across Sho earlier. It looks very interesting. (If only Python 3.x support was available, though it does look like they have added support for their own math and visualization libraries). > > I am going over the demos and the unit tests and I was able to write a simple console application to access .NET objects from Python. This is very encouraging! > I am still figuring out how to embed Python code in my C# WinForms application (instead of a console application). > > I will continue my experiments, but in the meantime if you or anyone else has any ideas on how to redirect the result from the Python interpreter (say, to a rich text box), I would love to hear them. That is one part of the puzzle that is unclear to me. > > Thanks, > Saparya > > On Wed, May 11, 2016 at 4:01 PM, Denis Akhiyarov wrote: > This is definitely possible with WinForms or WPF. See the demo folder in pythonnet repo. One of the demo's is still in pull request. > > You should probably just try running previous IronPython attempts using pythonnet and report issues if any. Have a look at Sho from Microsoft. > > There is someone trying to embed ipython REPL using pythonnet/Excel-DNA or COM in Excel with Custom Task Pane (CTP) written in WinForms: > > https://groups.google.com/forum/#!topic/jupyter/CVht4orvQtc > > > > > > On Wed, May 11, 2016 at 4:44 PM, Saparya K wrote: > Hello PythonNet, > > I am looking to embed a Python interactive (REPL) shell in a .NET WinForms application. > This C# application displays a graphical visualization of some data. Methods to manipulate the data in the C# application would be exposed via a Python API. > The idea is to be able to interact with the data from the Python shell via the API, and thereby updating the graphical view. > > Ideally, the shell should support any valid Python syntax that is required to use the API. This would involve: > ? Querying a collection of data from the application via the Python API > ? Then manipulating this collection in the Python shell > ? Making API calls with the modified collection as an argument > I came across a few examples where an interactive shell was developed using IronPython. A limitation with this approach is the absence of Python 3.x support (and other C-compiled libraries) in IronPython. For this reason, I would prefer to use Python.NET if it is possible. > > Has anyone here tried something like this with Python.NET before? Does it looks like what I am trying to achieve is feasible? > > Any direction would be very helpful! > > _________________________________________________ > Python.NET mailing list - PythonDotNet at python.org > https://mail.python.org/mailman/listinfo/pythondotnet > > > _________________________________________________ > Python.NET mailing list - PythonDotNet at python.org > https://mail.python.org/mailman/listinfo/pythondotnet > > > _________________________________________________ > Python.NET mailing list - PythonDotNet at python.org > https://mail.python.org/mailman/listinfo/pythondotnet > > > _________________________________________________ > Python.NET mailing list - PythonDotNet at python.org > https://mail.python.org/mailman/listinfo/pythondotnet > > > _________________________________________________ > Python.NET mailing list - PythonDotNet at python.org > https://mail.python.org/mailman/listinfo/pythondotnet > > > _________________________________________________ > Python.NET mailing list - PythonDotNet at python.org > https://mail.python.org/mailman/listinfo/pythondotnet ? Cameron From rharding64 at yahoo.com Fri May 27 20:44:39 2016 From: rharding64 at yahoo.com (Ron Harding) Date: Sat, 28 May 2016 00:44:39 +0000 (UTC) Subject: [Python.NET] Embedding a Python interactive shell in a .NET application In-Reply-To: References: Message-ID: <1934568139.691260.1464396279314.JavaMail.yahoo@mail.yahoo.com> sounds great; one additional suggestion, ?don't just use a plane jane .net text box, but instead use ?a 'rich text box'. ?why? ?i have used it again and again in smart terminal emulator windows where properties like 'append' are built in, plus it is easy to build in self scrolling, and colored prompts for different data i.e. >>>output, << wrote: Just in case someone stumbles on this post looking for an answer:A solution that worked for me was redirecting the Python stdout/stderr to a stream in Python. I was then able to route this stream into the .NET text box.private void button1_Click(object sender, EventArgs e) { using (Py.GIL()) { // Redirect stdout to text box dynamic sys = PythonEngine.ImportModule("sys"); string codeToRedirectOutput = "import sys\n" + "from io import StringIO\n" + "sys.stdout = mystdout = StringIO()\n" + "sys.stdout.flush()\n" + "sys.stderr = mystderr = StringIO()\n" + "sys.stderr.flush()\n"; PythonEngine.RunString(codeToRedirectOutput); // Run Python code string pyCode = "print(1 + 2)"; PyObject result = PythonEngine.RunString(pyCode); // null in case of error if (result != null) { string pyStdout = sys.stdout.getvalue(); // Get stdout pyStdout = pyStdout.Replace("\n", "\r\n"); // To support newline for textbox textBox1.Text = pyStdout; } else { PythonEngine.PrintError(); // Make Python engine print errors string pyStderr = sys.stderr.getvalue(); // Get stderr pyStderr = pyStderr.Replace("\n", "\r\n"); // To support newline for textbox textBox1.Text = pyStderr; } } }With this code, I was able to redirect the stdout (and stderr in the case of an error) from the Python engine to a .NET text box. On Wed, May 18, 2016 at 12:02 AM, Saparya K wrote: Hi Denis,Thanks for pointing me to the new API. I am now able to embed Python in my C# code and access Python classes and methods from C#! Hi Nils,Your application looks very interesting and some of the features (e.g. matplotlib integration) are on the lines of what I have been thinking about. I am far from there though and will need to learn more before I can follow all the code in your wrapper! ----- As of now, I am?trying to redirect the output from the Python interpreter to a .NET text box. While I am able to redirect the output to a file, I am having trouble with routing the output to a text box.? I first tried to redirect the console output to a custom TextWriter using Console.SetOut in C#: private void Form1_Load(object sender, EventArgs e){? ? _writer = new TextBoxWriter(this.textBox1);? ? Console.SetOut(_writer); ? ?// Redirect stdout to custom TextWriter that writes to the text box} This did not work: while output from C# is routed to the text box, output from Python is not. ----- I then thought that maybe I need to redirect the Python stdout instead of the C# standard output. The idea was to assign Python's sys.stdout to a .NET object that implements the same interface as a python stream (write(), writelines()...): .NET class to mimic Python stream: - public class TextBoxStream : PyObject // To assign to sys.stdout. Is this correct? { private TextBox _output = null; public TextBoxStream() {} public TextBoxStream(TextBox output) { _output = output; } void write(object value) { _output.AppendText(value.ToString()); } }In Form1.cs: private void button1_Click(object sender, EventArgs e) { using (Py.GIL()) { // Redirect stdout to text box dynamic sys = PythonEngine.ImportModule("sys"); TextBoxStream textBoxStream = new TextBoxStream(textBox1); sys.stdout = textBoxStream; // This is probably not theright way? //sys.SetAttr("stdout", textBoxStream); // This did not work either string code = "import sys\n" + "print 'Message 1'\n" + "sys.stdout.write('Message 2')\n" + "sys.stdout.flush()"; PyObject redirectPyObj = PythonEngine.RunString(code); // returns NULL sys.stdout.write("Message 3"); // Exception thrown: 'Python.Runtime.PyObject' does not contain a definition for 'stdout' } } This does not work either: redirectPyObj is NULL. I tried using the old as well as the new Python.NET API (with dynamic). Neither the sys.stdout.write nor the print statements write to the text box.Any ideas on how to approach this would be very helpful.Thanks,Saparya On Tue, May 17, 2016 at 3:33 AM, Nils Becker wrote: Hey, a while ago I wrote something like a light wrapper around Python.NET to embed CPython with numpy/scipy in a .NET GUI. It manages local/global dictionaries, automatically converts simple data types and numpy arrrays<->C# arrays and provides a plotting widget in C# that shows matplotlib plots. It also has some other convenience functions. The code is by no means complete, fully tested or even nice. However, for me it works. I uploaded it to github:?https://github.com/Lodomir/PythonInterfaceAs it demonstrates some not-well documented use of Python.NET, I thought it maybe nice to share the code. You will need to add the references to Python.NET to build the main project (PythonInterface) and additionally to the PythonInterface-DLL to build the examples. CheersNils 2016-05-13 22:04 GMT+02:00 Denis Akhiyarov : for embedding look at c# embedding unit tests and also here: 1. Old API: http://pythonnet.github.io/readme.html 2. New simplified API using dynamic: https://github.com/pythonnet/pythonnet/blob/master/README.md On Thu, May 12, 2016 at 4:16 PM, Saparya K wrote: Thanks for your response, Denis.? I had not come across Sho earlier. It looks very interesting. (If only Python 3.x support was available, though it does look like they have added support for their own math and visualization libraries).? I am going over the demos and the unit tests and I was able to write a simple console application to access .NET objects from Python. This is very encouraging!?I am still figuring out how to embed Python code in my C# WinForms application (instead of a console application). I will continue my experiments, but in the meantime if you or anyone else has any ideas on how to redirect the result from the Python interpreter (say, to a rich text box), I would love to hear them. That is one part of the puzzle that is unclear to me. Thanks,Saparya On Wed, May 11, 2016 at 4:01 PM, Denis Akhiyarov wrote: This is definitely possible with WinForms or WPF. See the demo folder in pythonnet repo. One of the demo's is still in pull request. You should probably just try running previous IronPython attempts using pythonnet and report issues if any. Have a look at Sho from Microsoft. There is someone trying to embed ipython REPL using pythonnet/Excel-DNA or COM in Excel with?Custom Task Pane (CTP)?written in?WinForms: https://groups.google.com/forum/#!topic/jupyter/CVht4orvQtc On Wed, May 11, 2016 at 4:44 PM, Saparya K wrote: Hello PythonNet, I am looking to embed?a Python interactive (REPL) shell in a .NET WinForms application.This C# application displays a graphical visualization of some data. Methods to manipulate the data in the C# application would be exposed via a Python API.The idea is to be able to interact with the data from the Python shell via the API, and thereby updating the graphical view.? Ideally, the shell should support any valid Python syntax that is required to use the API. This would involve: - Querying a collection of data from the application via the Python API - Then manipulating this collection in the Python shell - Making API calls with the modified collection as an argument I came across a few examples where an interactive shell was developed using IronPython. A limitation with this approach is the absence of?Python 3.x?support (and other C-compiled libraries) in IronPython. For this reason, I would prefer to use Python.NET if it is possible. Has anyone here tried something like this with Python.NET before? Does it looks like what I am trying to achieve is feasible? Any direction would be very helpful! _________________________________________________ Python.NET mailing list - PythonDotNet at python.org https://mail.python.org/mailman/listinfo/pythondotnet _________________________________________________ Python.NET mailing list - PythonDotNet at python.org https://mail.python.org/mailman/listinfo/pythondotnet _________________________________________________ Python.NET mailing list - PythonDotNet at python.org https://mail.python.org/mailman/listinfo/pythondotnet _________________________________________________ Python.NET mailing list - PythonDotNet at python.org https://mail.python.org/mailman/listinfo/pythondotnet _________________________________________________ Python.NET mailing list - PythonDotNet at python.org https://mail.python.org/mailman/listinfo/pythondotnet _________________________________________________ Python.NET mailing list - PythonDotNet at python.org https://mail.python.org/mailman/listinfo/pythondotnet -------------- next part -------------- An HTML attachment was scrubbed... URL: From fernandez_dan2 at hotmail.com Sat May 28 00:02:14 2016 From: fernandez_dan2 at hotmail.com (Daniel Fernandez) Date: Fri, 27 May 2016 22:02:14 -0600 Subject: [Python.NET] Issue with beautifulsoup 4 Message-ID: Hey Everyone, I'm running into an issue importing beautifulsoup 4 only if I import clr before importing beautifulsoup. I'm using python 3.5 32-bit version on my Windows 7 and Windows 10 box. I'm using beautifulsoup package from Gohlke website (beautifulsoup4-4.4.1-py3-none-any.whl) I simply runimport clrfrom bs4 import beautifulsoup then I get this error Unhandled Exception: System.ArgumentException: Name must not be empty! at Python.Runtime.ModuleObject..ctor(String name) at Python.Runtime.ModuleObject.GetAttribute(String name, Boolean guess) at Python.Runtime.ImportHook.__import__(IntPtr self, IntPtr args, IntPtr kw) at Python.Runtime.Runtime.PyObject_Call(IntPtr pointer, IntPtr args, IntPtr kw) at Python.Runtime.ImportHook.__import__(IntPtr self, IntPtr args, IntPtr kw) at Python.Runtime.Runtime.PyObject_Call(IntPtr pointer, IntPtr args, IntPtr kw) at Python.Runtime.ImportHook.__import__(IntPtr self, IntPtr args, IntPtr kw) I build the pythonnet debug version I get this call stack Unhandled Exception: System.ArgumentException: Name must not be empty! at Python.Runtime.ModuleObject..ctor(String name) in pythonnet\src\runtime\moduleobject.cs:line 26 at Python.Runtime.ModuleObject.GetAttribute(String name, Boolean guess) in pythonnet\src\runtime\moduleobject.cs:line 101 at Python.Runtime.ImportHook.__import__(IntPtr self, IntPtr args, IntPtr kw) in pythonnet\src\runtime\importhook.cs:line 315 at Python.Runtime.Runtime.PyObject_Call(IntPtr pointer, IntPtr args, IntPtr kw) at Python.Runtime.ImportHook.__import__(IntPtr self, IntPtr args, IntPtr kw) in pythonnet\src\runtime\importhook.cs:line 237 at Python.Runtime.Runtime.PyObject_Call(IntPtr pointer, IntPtr args, IntPtr kw) at Python.Runtime.ImportHook.__import__(IntPtr self, IntPtr args, IntPtr kw) in pythonnet\src\runtime\importhook.cs:line 237 if I switch the lines of codefrom bs4 import Beautifulsoupimport clr no errors occur. Is anyone running into this issue? Thanks. Danny -------------- next part -------------- An HTML attachment was scrubbed... URL: From denis.akhiyarov at gmail.com Sat May 28 12:55:28 2016 From: denis.akhiyarov at gmail.com (Denis Akhiyarov) Date: Sat, 28 May 2016 11:55:28 -0500 Subject: [Python.NET] Issue with beautifulsoup 4 In-Reply-To: References: Message-ID: There is pending pull request hopefully addressing this issue: https://github.com/pythonnet/pythonnet/pull/219 If not, then please open an issue on github or comment on that pull request. On Friday, May 27, 2016, Daniel Fernandez wrote: > Hey Everyone, > > I'm running into an issue importing beautifulsoup 4 only if I import clr > before importing beautifulsoup. I'm using python 3.5 32-bit version on my > Windows 7 and Windows 10 box. I'm using beautifulsoup package from Gohlke > website (beautifulsoup4-4.4.1-py3-none-any.whl) > > I simply run > import clr > from bs4 import beautifulsoup > > then I get this error > > Unhandled Exception: System.ArgumentException: Name must not be empty! > at Python.Runtime.ModuleObject..ctor(String name) > at Python.Runtime.ModuleObject.GetAttribute(String name, Boolean guess) > at Python.Runtime.ImportHook.__import__(IntPtr self, IntPtr args, > IntPtr kw) > at Python.Runtime.Runtime.PyObject_Call(IntPtr pointer, IntPtr args, > IntPtr kw) > at Python.Runtime.ImportHook.__import__(IntPtr self, IntPtr args, > IntPtr kw) > at Python.Runtime.Runtime.PyObject_Call(IntPtr pointer, IntPtr args, > IntPtr kw) > at Python.Runtime.ImportHook.__import__(IntPtr self, IntPtr args, > IntPtr kw) > > > I build the pythonnet debug version I get this call stack > > Unhandled Exception: System.ArgumentException: Name must not be empty! > at Python.Runtime.ModuleObject..ctor(String name) in > pythonnet\src\runtime\moduleobject.cs:line 26 > at Python.Runtime.ModuleObject.GetAttribute(String name, Boolean guess) > in pythonnet\src\runtime\moduleobject.cs:line 101 > at Python.Runtime.ImportHook.__import__(IntPtr self, IntPtr args, > IntPtr kw) in pythonnet\src\runtime\importhook.cs:line 315 > at Python.Runtime.Runtime.PyObject_Call(IntPtr pointer, IntPtr args, > IntPtr kw) > at Python.Runtime.ImportHook.__import__(IntPtr self, IntPtr args, > IntPtr kw) in pythonnet\src\runtime\importhook.cs:line 237 > at Python.Runtime.Runtime.PyObject_Call(IntPtr pointer, IntPtr args, > IntPtr kw) > at Python.Runtime.ImportHook.__import__(IntPtr self, IntPtr args, > IntPtr kw) in pythonnet\src\runtime\importhook.cs:line 237 > > > if I switch the lines of code > from bs4 import Beautifulsoup > import clr > > no errors occur. Is anyone running into this issue? > > Thanks. > > Danny > -------------- next part -------------- An HTML attachment was scrubbed... URL: From fernandez_dan2 at hotmail.com Sat May 28 14:38:21 2016 From: fernandez_dan2 at hotmail.com (Daniel Fernandez) Date: Sat, 28 May 2016 12:38:21 -0600 Subject: [Python.NET] Issue with beautifulsoup 4 In-Reply-To: References: Message-ID: Hi All, I narrow down the issue to a relative import of html5lib. I see there is already a pull request (https://github.com/pythonnet/pythonnet/pull/219) that addresses this relative import issue chaning the importhook.cs. Thanks. Danny From: fernandez_dan2 at hotmail.com To: pythondotnet at python.org Date: Fri, 27 May 2016 22:02:14 -0600 Subject: [Python.NET] Issue with beautifulsoup 4 Hey Everyone, I'm running into an issue importing beautifulsoup 4 only if I import clr before importing beautifulsoup. I'm using python 3.5 32-bit version on my Windows 7 and Windows 10 box. I'm using beautifulsoup package from Gohlke website (beautifulsoup4-4.4.1-py3-none-any.whl) I simply runimport clrfrom bs4 import beautifulsoup then I get this error Unhandled Exception: System.ArgumentException: Name must not be empty! at Python.Runtime.ModuleObject..ctor(String name) at Python.Runtime.ModuleObject.GetAttribute(String name, Boolean guess) at Python.Runtime.ImportHook.__import__(IntPtr self, IntPtr args, IntPtr kw) at Python.Runtime.Runtime.PyObject_Call(IntPtr pointer, IntPtr args, IntPtr kw) at Python.Runtime.ImportHook.__import__(IntPtr self, IntPtr args, IntPtr kw) at Python.Runtime.Runtime.PyObject_Call(IntPtr pointer, IntPtr args, IntPtr kw) at Python.Runtime.ImportHook.__import__(IntPtr self, IntPtr args, IntPtr kw) I build the pythonnet debug version I get this call stack Unhandled Exception: System.ArgumentException: Name must not be empty! at Python.Runtime.ModuleObject..ctor(String name) in pythonnet\src\runtime\moduleobject.cs:line 26 at Python.Runtime.ModuleObject.GetAttribute(String name, Boolean guess) in pythonnet\src\runtime\moduleobject.cs:line 101 at Python.Runtime.ImportHook.__import__(IntPtr self, IntPtr args, IntPtr kw) in pythonnet\src\runtime\importhook.cs:line 315 at Python.Runtime.Runtime.PyObject_Call(IntPtr pointer, IntPtr args, IntPtr kw) at Python.Runtime.ImportHook.__import__(IntPtr self, IntPtr args, IntPtr kw) in pythonnet\src\runtime\importhook.cs:line 237 at Python.Runtime.Runtime.PyObject_Call(IntPtr pointer, IntPtr args, IntPtr kw) at Python.Runtime.ImportHook.__import__(IntPtr self, IntPtr args, IntPtr kw) in pythonnet\src\runtime\importhook.cs:line 237 if I switch the lines of codefrom bs4 import Beautifulsoupimport clr no errors occur. Is anyone running into this issue? Thanks. Danny _________________________________________________ Python.NET mailing list - PythonDotNet at python.org https://mail.python.org/mailman/listinfo/pythondotnet -------------- next part -------------- An HTML attachment was scrubbed... URL: From fernandez_dan2 at hotmail.com Sun May 29 11:34:34 2016 From: fernandez_dan2 at hotmail.com (Daniel Fernandez) Date: Sun, 29 May 2016 09:34:34 -0600 Subject: [Python.NET] Issue with beautifulsoup 4 In-Reply-To: References: , Message-ID: Hi Denis, I just verified that this does fix the issue with the local import in this specific case. Any idea when the pull request will be accepted? Danny Date: Sat, 28 May 2016 11:55:28 -0500 From: denis.akhiyarov at gmail.com To: pythondotnet at python.org Subject: Re: [Python.NET] Issue with beautifulsoup 4 There is pending pull request hopefully addressing this issue: https://github.com/pythonnet/pythonnet/pull/219 If not, then please open an issue on github or comment on that pull request. On Friday, May 27, 2016, Daniel Fernandez wrote: Hey Everyone, I'm running into an issue importing beautifulsoup 4 only if I import clr before importing beautifulsoup. I'm using python 3.5 32-bit version on my Windows 7 and Windows 10 box. I'm using beautifulsoup package from Gohlke website (beautifulsoup4-4.4.1-py3-none-any.whl) I simply runimport clrfrom bs4 import beautifulsoup then I get this error Unhandled Exception: System.ArgumentException: Name must not be empty! at Python.Runtime.ModuleObject..ctor(String name) at Python.Runtime.ModuleObject.GetAttribute(String name, Boolean guess) at Python.Runtime.ImportHook.__import__(IntPtr self, IntPtr args, IntPtr kw) at Python.Runtime.Runtime.PyObject_Call(IntPtr pointer, IntPtr args, IntPtr kw) at Python.Runtime.ImportHook.__import__(IntPtr self, IntPtr args, IntPtr kw) at Python.Runtime.Runtime.PyObject_Call(IntPtr pointer, IntPtr args, IntPtr kw) at Python.Runtime.ImportHook.__import__(IntPtr self, IntPtr args, IntPtr kw) I build the pythonnet debug version I get this call stack Unhandled Exception: System.ArgumentException: Name must not be empty! at Python.Runtime.ModuleObject..ctor(String name) in pythonnet\src\runtime\moduleobject.cs:line 26 at Python.Runtime.ModuleObject.GetAttribute(String name, Boolean guess) in pythonnet\src\runtime\moduleobject.cs:line 101 at Python.Runtime.ImportHook.__import__(IntPtr self, IntPtr args, IntPtr kw) in pythonnet\src\runtime\importhook.cs:line 315 at Python.Runtime.Runtime.PyObject_Call(IntPtr pointer, IntPtr args, IntPtr kw) at Python.Runtime.ImportHook.__import__(IntPtr self, IntPtr args, IntPtr kw) in pythonnet\src\runtime\importhook.cs:line 237 at Python.Runtime.Runtime.PyObject_Call(IntPtr pointer, IntPtr args, IntPtr kw) at Python.Runtime.ImportHook.__import__(IntPtr self, IntPtr args, IntPtr kw) in pythonnet\src\runtime\importhook.cs:line 237 if I switch the lines of codefrom bs4 import Beautifulsoupimport clr no errors occur. Is anyone running into this issue? Thanks. Danny _________________________________________________ Python.NET mailing list - PythonDotNet at python.org https://mail.python.org/mailman/listinfo/pythondotnet -------------- next part -------------- An HTML attachment was scrubbed... URL: From denis.akhiyarov at gmail.com Tue May 31 00:41:57 2016 From: denis.akhiyarov at gmail.com (Denis Akhiyarov) Date: Mon, 30 May 2016 23:41:57 -0500 Subject: [Python.NET] Issue with beautifulsoup 4 In-Reply-To: References: Message-ID: Hi Danny, I'm aware of few things that prevent merging this pull request at current state: 1. [VERY SIMPLE FIX] c# 6 syntax was used in this pull request, but should be downgraded to c# 4 due to .NET 4.0 and Mono. This can be re-considered if someone is willing to look into this closer. 2. Writing unit tests for this pull request. 3. De-couple the fix for build script from this pull request. Appveyor builds and tests were failing before, but seem to be working now. If anyone is willing to finish off this pull request, then the author seems to be fine: https://github.com/pythonnet/pythonnet/pull/219#issuecomment-222077108 Thanks, Denis On Sun, May 29, 2016 at 10:34 AM, Daniel Fernandez < fernandez_dan2 at hotmail.com> wrote: > Hi Denis, > > I just verified that this does fix the issue with the local import in this > specific case. Any idea when the pull request will be accepted? > > Danny > ------------------------------ > Date: Sat, 28 May 2016 11:55:28 -0500 > From: denis.akhiyarov at gmail.com > To: pythondotnet at python.org > Subject: Re: [Python.NET] Issue with beautifulsoup 4 > > There is pending pull request hopefully addressing this issue: > > https://github.com/pythonnet/pythonnet/pull/219 > > > If not, then please open an issue on github or comment on that pull > request. > > > > On Friday, May 27, 2016, Daniel Fernandez > wrote: > > Hey Everyone, > > I'm running into an issue importing beautifulsoup 4 only if I import clr > before importing beautifulsoup. I'm using python 3.5 32-bit version on my > Windows 7 and Windows 10 box. I'm using beautifulsoup package from Gohlke > website (beautifulsoup4-4.4.1-py3-none-any.whl) > > I simply run > import clr > from bs4 import beautifulsoup > > then I get this error > > Unhandled Exception: System.ArgumentException: Name must not be empty! > at Python.Runtime.ModuleObject..ctor(String name) > at Python.Runtime.ModuleObject.GetAttribute(String name, Boolean guess) > at Python.Runtime.ImportHook.__import__(IntPtr self, IntPtr args, > IntPtr kw) > at Python.Runtime.Runtime.PyObject_Call(IntPtr pointer, IntPtr args, > IntPtr kw) > at Python.Runtime.ImportHook.__import__(IntPtr self, IntPtr args, > IntPtr kw) > at Python.Runtime.Runtime.PyObject_Call(IntPtr pointer, IntPtr args, > IntPtr kw) > at Python.Runtime.ImportHook.__import__(IntPtr self, IntPtr args, > IntPtr kw) > > > I build the pythonnet debug version I get this call stack > > Unhandled Exception: System.ArgumentException: Name must not be empty! > at Python.Runtime.ModuleObject..ctor(String name) in > pythonnet\src\runtime\moduleobject.cs:line 26 > at Python.Runtime.ModuleObject.GetAttribute(String name, Boolean guess) > in pythonnet\src\runtime\moduleobject.cs:line 101 > at Python.Runtime.ImportHook.__import__(IntPtr self, IntPtr args, > IntPtr kw) in pythonnet\src\runtime\importhook.cs:line 315 > at Python.Runtime.Runtime.PyObject_Call(IntPtr pointer, IntPtr args, > IntPtr kw) > at Python.Runtime.ImportHook.__import__(IntPtr self, IntPtr args, > IntPtr kw) in pythonnet\src\runtime\importhook.cs:line 237 > at Python.Runtime.Runtime.PyObject_Call(IntPtr pointer, IntPtr args, > IntPtr kw) > at Python.Runtime.ImportHook.__import__(IntPtr self, IntPtr args, > IntPtr kw) in pythonnet\src\runtime\importhook.cs:line 237 > > > if I switch the lines of code > from bs4 import Beautifulsoup > import clr > > no errors occur. Is anyone running into this issue? > > Thanks. > > Danny > > > _________________________________________________ Python.NET mailing list > - PythonDotNet at python.org > https://mail.python.org/mailman/listinfo/pythondotnet > > _________________________________________________ > Python.NET mailing list - PythonDotNet at python.org > https://mail.python.org/mailman/listinfo/pythondotnet > -------------- next part -------------- An HTML attachment was scrubbed... URL: From denis.akhiyarov at gmail.com Tue May 31 09:48:16 2016 From: denis.akhiyarov at gmail.com (Denis Akhiyarov) Date: Tue, 31 May 2016 08:48:16 -0500 Subject: [Python.NET] Explicitly implemented interface methods In-Reply-To: <011DF2B6-5148-4F04-84AD-F605E7F790ED@comprion.com> References: <202470c362974c20a94fc96c084d08ae@ex2013.orga-test.local> <011DF2B6-5148-4F04-84AD-F605E7F790ED@comprion.com> Message-ID: Hi Henning, You can build, debug and develop Python.Runtime.DLL right from one place - Visual Studio. Free editions or community version (if you qualify) will let you do most of the things. The added benefit is that you can also use Python Tools for Visual Studio as your IDE for Python. Cheers, Denis On Wed, May 25, 2016 at 10:57 AM, Henning Moeller wrote: > Hi Tony, > > This is not a solution for the change but only an idea. I don?t know the > concept of PythonNet well enough to figure out where to add the proposed > change. And I don?t have a proper development environment to integrate and > test the change. That?s why I try to advertise it in the mailing list. > > I?d be ready to contribute, though. Could you point me to resources on how > to debug the Python.Runtime.dll? > > Best regards, > > Henning > > > _________________________________________________ > Python.NET mailing list - PythonDotNet at python.org > https://mail.python.org/mailman/listinfo/pythondotnet > -------------- next part -------------- An HTML attachment was scrubbed... URL: