Re: [Python.NET] cvs -> svn -> git history of Python for .NET

2016-09-08 Thread Tony Roberts
Some files were moved some time after being imported from svn. You need to use --follow to follow renames/moves, i.e: git log --follow src/embed_tests/pyimport.cs All commits from svn were imported into git (and are still there). The one you mention is here: https://github.com/pythonnet/pythonnet

Re: [Python.NET] Explicitly implemented interface methods

2016-05-25 Thread Tony Roberts
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

Re: [Python.NET] calling Python via Python.Runtime DLL from IronPython

2016-04-22 Thread Tony Roberts
ine.Initialize(), but I got the same problem (re ‘copy_reg’ not >> found). >> Any other suggestions? >> -- >> Cameron Hayne >> cameron.ha...@introspect.ca >> >> >> On Apr 19, 2016, at 4:37 PM, Tony Roberts wrote: >> >> > No need to i

Re: [Python.NET] calling Python via Python.Runtime DLL from IronPython

2016-04-19 Thread Tony Roberts
No need to import the c Python extension - from IronPython you would be able to reference the Python.runtime assembly without it. The problem you're having sounds like the python path isn't correct for cPython. You could try setting the PYTHONHOME environment variable and see if that gets you any f

[Python.NET] Python.NET 2.1 released

2016-04-12 Thread Tony Roberts
would be particularly appreciated. Contributors/github users: please note I have merged the develop branch back into master and pull requests will now be accepted against the master branch. Best regards, Tony Roberts www.pyxll.com _ Python.NET ma

Re: [Python.NET] "Incorrect" behavior of inheriting from class which is inherited from .Net class

2016-04-11 Thread Tony Roberts
Hi, yes, deriving from a python class in Python that itself is derived from a .net class doesn't work. Apologies, if I'd known that was what you were doing I could have saved you some time by telling you that earlier. AFAIK this hasn't been created as an issue in github, so please if you could do

Re: [Python.NET] How to handle INotifyPropertyChanged interface

2016-04-04 Thread Tony Roberts
ok? seems like people were able to do this in ironpython: > > http://stackoverflow.com/questions/3856905/ > > On Sun, Apr 3, 2016 at 10:40 AM, Tony Roberts wrote: > >> Yeah, it looks like the crash is probably because of the missing event >> implementation as suspected. I&

Re: [Python.NET] How to handle INotifyPropertyChanged interface

2016-04-03 Thread Tony Roberts
Yeah, it looks like the crash is probably because of the missing event implementation as suspected. I'm a bit surprised that it didn't fail earlier when trying to instantiate the type. If you do get a chance to take a look at adding that functionality be sure to submit a pull request! Best regard

Re: [Python.NET] How to handle INotifyPropertyChanged interface

2016-04-03 Thread Tony Roberts
What's the full stack trace? I suspect it's something to do with the event declared on the interface not being implemented. The managed type constructed doesn't define any events, so that would cause the construction of the type of fail - which is probably the error you're getting (although withou

Re: [Python.NET] PyTuple IDisposable implementation

2016-03-31 Thread Tony Roberts
When the tuple is destroyed each of the members will have their reference count decremented. The tuple 'steals' the references of the members when it's constructed, hence why there's the call to Incref and no need for a corresponding decref. This happens in the Python C API and so there's no need t

Re: [Python.NET] Can a python class passed back to .Net

2016-03-19 Thread Tony Roberts
You have to decorate the methods you want to expose to .net with the clrmethod decorator, e.g. class MyClass(IInterface): @clrmethod(int, [str]) def overridden_method(self, x): return len(x) The parameters to the clrmethod decorator are the method return type and argument types. Y

Re: [Python.NET] Memory leak problem in function "AsManagedObject"

2016-01-20 Thread Tony Roberts
fter I ran that statement 5 thousand times I got this: >>> >>> >>> [image: Imagem inline 1] >>> >>> >>> As you can see more that 12 thousand instances of “PyInt” and more than >>> 6 thousand of “PyObject” are created . Apparently it is cre

Re: [Python.NET] Memory leak problem in function "AsManagedObject"

2016-01-19 Thread Tony Roberts
my code and this just happens when I > call “AsManagedObject”. > > > > Let me know if there is a newer version that could probably have that > problem fixed which I am not aware of. > > > I appreciate a lot your help! > > > > Best regards, > > Eliana >

Re: [Python.NET] Memory leak problem in function "AsManagedObject"

2016-01-17 Thread Tony Roberts
Hi Eliana, which version of pythonnet are you using? when you say you're using the latest are you building it yourself from the develop branch on github? I had a quick look at the code that converts from a python object to a double, and I don't see any obvious memory leaks there. Perhaps the leak

Re: [Python.NET] Build guide for Python.NET using Mono on Linux?

2015-09-11 Thread Tony Roberts
Look at .travis.yml or the travis-ci jobs to see how to build on Linux. Tony On Thu, Sep 10, 2015 at 10:35 PM Denis Akhiyarov wrote: > You need to change the configuration of build to Mono from Win. Maybe > MonoDevelop supports this for solution/project files? If you build using > setup.py wha

Re: [Python.NET] It is possible to build pythonnet on python 3.4 with visual studio 2015?

2015-09-03 Thread Tony Roberts
Hi, take a look at setup.py. That's the easiest way to build it for Python 3.4 (you can use the solution, but you'll need to edit some settings - check setup.py to see what it sets). You should be able to modify setup.py to make it pick up VS 2015 easily enough. regards, Tony On Wed, Sep 2, 201

Re: [Python.NET] Debugging CPYTHON embedded in .NET

2015-07-10 Thread Tony Roberts
Hi Denis, you can use the remote debugger in PyCharm to attach to your .NET process. It requires a small bit of python code in your application to make it connect to the PyCharm debug server, but it works very well. See the instructions here: http://blog.jetbrains.com/pycharm/2010/12/python-remot

Re: [Python.NET] Action delegate in Python 3.4

2015-07-01 Thread Tony Roberts
Hi, looks like this just hasn't been implemented yet. I don't think it's specific to the 3.4 build. Could you create a github issue with your example if you get a chance? ( https://github.com/pythonnet/pythonnet/) If you want to have a go at implementing it yourself, take a look at the classes D

[Python.NET] pythonnet 2.1.0.dev1 released

2015-06-26 Thread Tony Roberts
Hi, I've merged the changes from the renshawbay/pythonnet fork into the develop branch in pythonnet/pythonnet and released it as 2.1.0.dev1. Binary wheels for windows (2.6 to 3.4, x86 and x86_64) have been uploaded to PyPI, along with the source dist for Linux and Mac. You can install it with pip

[Python.NET] pythonnet 2.0.0 released

2015-06-26 Thread Tony Roberts
Hi, I've finally gotten round to finishing off the last couple of things that were blocking an 'official' 2.0.0 release (to do with packaging as wheels/source dist). There is now a 2.0.0 release available on PyPI ( https://pypi.python.org/pypi/pythonnet), with binary wheels for Windows (32 and 64

Re: [Python.NET] Python .net and wpf: it's possible?

2015-06-22 Thread Tony Roberts
Hi Germano, It helps to look at the full exception and stack trace, not just the exception type. In this case you probably got this error "System.InvalidOperationException: The calling thread must be STA, because many UI components require this." which tells you that the main thread you're calling

Re: [Python.NET] Pythonwin crash on from import

2015-06-18 Thread Tony Roberts
Hi Vincenzo, are you using the pythonnet/pythonnet repo on github? If so, you can modify the setup.py file to build a debug version (set CONFIG="Debug" near the top of the file). You can then attach the visual studio debugger to your python process and step through the C# code. If you're using the

Re: [Python.NET] surveying the landscape ...

2015-06-16 Thread Tony Roberts
ground, I was a major contributor to the pandas > library for a time; my firm is behind the Deedle library ( > https://github.com/BlueMountainCapital/Deedle). > > To state the obvious, the project has proven hugely valuable. BlueMountain > has an interest in making sure the library doe

Re: [Python.NET] Python for .NET load .dll

2015-06-08 Thread Tony Roberts
Hi, I seem to remember some problems possibly related to this... those binaries you've found are quite old now. As a first set I would recommend checking out the latest source from github and building the pythonnet binaries yourself. It should be as simple as running "python setup.py install" (or

Re: [Python.NET] Decref in RunString

2015-06-08 Thread Tony Roberts
Looks like a copy and paste error from RunString(string code) to me. If you want to send a pull request to fix it (with a unit test if you have one - I don't think RunString is currently covered by the tests) I'll merge it. thanks! Tony On Mon, Jun 8, 2015 at 7:52 AM Nils Becker wrote: > Hell

Re: [Python.NET] Does python .net support creating a class inherited from an interface class declared by c#?

2015-04-21 Thread Tony Roberts
This is one of the features I added to this fork: https://github.com/renshawbay/pythonnet It's not yet integrated into the main repo, but you can build it from the source in github. Take a look at the test_subclass.py unit test here: https://github.com/renshawbay/pythonnet/blob/python3/src/tests/

Re: [Python.NET] Can anyone help me with a build of Python for .Net, that works with Windows 8.1?

2014-12-04 Thread Tony Roberts
That fix is in the develop branch on github ( https://github.com/pythonnet/pythonnet.git). You should be able to build it from there just by running the setup.py script, e.g. python setup.py install cheers, Tony On Tue, Dec 2, 2014 at 6:55 AM, Hans Peter Jepsen wrote: > Hi all > > I also ran

Re: [Python.NET] debugging

2014-11-11 Thread Tony Roberts
Hi Noel, any python ide should work fine. If you're using windows you can just use your regular python and import the clr module without using npython (npython is useful for linux where some distros have python built a certain way that means the clr module can't be imported). You could take a look

Re: [Python.NET] glibc invalid pointer when importing clr

2014-10-17 Thread Tony Roberts
Hi, probably your python has not been compiled with --enable-shared, and so it ends up loading the python core twice (once in the executable, and again in the so referenced by the pythonnet module). This means that the one pythonnet is using doesn't get initialized correctly. You could try buildi

Re: [Python.NET] Python.Net for Python3: bug when using an embedded interpreter

2014-09-30 Thread Tony Roberts
Should be fixed now. Please re-open if it's still a problem ( https://github.com/renshawbay/pythonnet/issues/13). cheers, Tony On Tue, Sep 30, 2014 at 4:57 PM, Tony Roberts wrote: > Hi Serge, > > I see what you're saying. It would think that bit just needs to be moved >

Re: [Python.NET] Python.Net for Python3: bug when using an embedded interpreter

2014-09-30 Thread Tony Roberts
Hi Serge, I see what you're saying. It would think that bit just needs to be moved until after we're sure python has been initialized so it works in both cases. I don't see any need to move it into a separate python module; having it compiled into one is cleaner IMHO. If you're not subclassing .NE

Re: [Python.NET] Running an embedded interpreter

2014-09-02 Thread Tony Roberts
Thanks Serge, that's done. cheers, Tony On Mon, Sep 1, 2014 at 7:28 AM, Serge WEINSTOCK < serge.weinst...@uk.bnpparibas.com> wrote: > It took me sometime to figure that I have to first fork, create a > branch, apply the patch, commit and create a pull request but I think I > have now understoo

Re: [Python.NET] Running an embedded interpreter

2014-08-27 Thread Tony Roberts
Hi Serge, I don't see your pull request here https://github.com/renshawbay/pythonnet/pulls, and I can't see your fork. Could you send me the url of your fork and I'll take a look if I can pull the changes from there? If you want to have another go at creating the pull request this might help:

Re: [Python.NET] Running an embedded interpreter

2014-08-27 Thread Tony Roberts
this might help: https://help.github.com/articles/creating-a-pull-request Best regards, Tony p.s. Apologies for the previous incomplete mail. My fat fingers sent it early! On Wed, Aug 27, 2014 at 5:33 PM, Tony Roberts wrote: > Hi Serge, > > I don't see your pull request here &g

Re: [Python.NET] Running an embedded interpreter

2014-08-26 Thread Tony Roberts
Hi Serge, ah great, good spot. Certainly, please send a pull request to the github repo and I'll merge it. thanks, Tony On Tue, Aug 26, 2014 at 1:07 AM, Serge WEINSTOCK < serge.weinst...@uk.bnpparibas.com> wrote: > Hi Tony, > > I think I've found the issue: > The signatures of Py_SetPythonHom

Re: [Python.NET] Running an embedded interpreter

2014-08-21 Thread Tony Roberts
Hi Serge, sorry, not sure why one would work and not the other. For what it's worth, I've been using the 3.2 x64 version for some time now, both for calling .NET from python and for embedding Python into a .NET application without any problem like the ones you describe. What I suggest you try is

Re: [Python.NET] Running an embedded interpreter

2014-08-19 Thread Tony Roberts
Hi Serge, 'mbcs' is what python uses to mean the current configured encoding. I would guess that the encoding of sys.stdout is different when using visual studio output console than the console. You could try a different encoding method by setting the PYTHONIOENCODING environment variable before

Re: [Python.NET] PythonDotNet Digest, Vol 122, Issue 17

2014-06-19 Thread Tony Roberts
> about this. > > Again, thank you very much for your help! > >Beckett > > > Date: Wed, 18 Jun 2014 19:30:30 +0100 > > From: Tony Roberts > > To: "A list for users and developers of Python for .NET" > > > > Subject: Re:

Re: [Python.NET] Python 3.4 Support

2014-06-18 Thread Tony Roberts
-bit base install. > Would this possibly be the problem? > >Beckett > > > Date: Tue, 17 Jun 2014 22:58:21 +0100 > > From: Tony Roberts > > > To: "A list for users and developers of Python for .NET" > > > > > Subject: Re: [Python.NET]

Re: [Python.NET] PythonDotNet Digest, Vol 122, Issue 13

2014-06-17 Thread Tony Roberts
sual C++ 2010 Express. And I also tried Visual Studio 2012 > Express too. (Making sure to adjust my environment path accordingly.) > > I just want to confirm that this is indeed a compiler issue and doesn't > have to do with the pythonnet code itself. > > Thanks, >Bec

Re: [Python.NET] Python 3.4 Support

2014-06-13 Thread Tony Roberts
Hi, use setupwin.py instead of setup.py in the renshawbay repo to build it. cheers, Tony On Fri, Jun 13, 2014 at 5:18 PM, Beckett Simmons wrote: > Hello all, > > I am trying to get pythonnet to build with python 3.4. I am on a Windows 7 > 64-bit machine and specifically want to use Python 3.4

Re: [Python.NET] homebrew pythonnet, versus pip install --pre pythonnet

2014-06-04 Thread Tony Roberts
rom this branch? That's a problem. Python.net <http://python.net/> is > also used to embed python. Therefore, it should build from IDE on all > platforms and also from an autotools system. > > > On Jun 4, 2014, at 6:15 AM, Tony Roberts wrote: > > Hi Adam, > > tha

Re: [Python.NET] homebrew pythonnet, versus pip install --pre pythonnet

2014-06-04 Thread Tony Roberts
Hi Adam, that 2.0.0.beta1 build was built from the source on github here: https://github.com/pythonnet/pythonnet You should build it using the setup.py script and not in the IDE. There are CI builds setup for both windows and linux (see README.md) if you want to see exactly how the wheel gets bu

Re: [Python.NET] Deprecation warnings

2014-04-09 Thread Tony Roberts
may be an issue on > my end. > > > > John > > > > *From:* PythonDotNet [mailto:pythondotnet-bounces+jgill= > tokiomillennium@python.org] *On Behalf Of *Tony Roberts > *Sent:* Wednesday, April 09, 2014 8:59 AM > *To:* A list for users and developers of Pyth

Re: [Python.NET] Deprecation warnings

2014-04-09 Thread Tony Roberts
Hi Jon, add clr.AddReference("System.Collections") to your code before the import. I'll take a look at why that warning message doesn't have the correct assembly name. cheers, Tony On Wed, Apr 9, 2014 at 12:36 PM, John Gill wrote: > I just upgraded to pythonnet 2.0 - thanks to "pip install -p

Re: [Python.NET] DocStringAttribute Example

2014-03-13 Thread Tony Roberts
I'm not familiar with how to build the pythondotnet source. >>> >>> >>> On Wed, Mar 12, 2014 at 11:59 AM, Jonno wrote: >>> >>>> My mistake Tony, >>>> >>>> I was using the 2.0 CLR version of pythondotnet which doesn'

Re: [Python.NET] DocStringAttribute Example

2014-03-12 Thread Tony Roberts
> statement. > > > On Fri, Mar 7, 2014 at 12:19 PM, Tony Roberts wrote: > >> Hi, >> >> if your class has a constructor then the class docstring will get >> replaced with a description of the constructor, even if you explicitly gave >> the class a d

Re: [Python.NET] DocStringAttribute Example

2014-03-07 Thread Tony Roberts
Hi, if your class has a constructor then the class docstring will get replaced with a description of the constructor, even if you explicitly gave the class a docstring using DocStringAttribute. I've created an issue for github for this and fixed it: https://github.com/pythonnet/pythonnet/issues/1

Re: [Python.NET] PTVS and python.NET

2013-11-27 Thread Tony Roberts
Hi David, that would seem to fit with the way most other projects work, and should make it easier for anyone looking for the project on github to find it. I'm happy to help out with the migration and maintenance if it is decided to go ahead with this. The fork I created doesn't have the history f

Re: [Python.NET] subclassing managed types in python

2013-10-17 Thread Tony Roberts
eally prefer to get super() working. If anyone has any ideas about how to get that working please let me know... cheers, Tony On Wed, Oct 9, 2013 at 10:27 AM, Tony Roberts wrote: > Hi, > > am I right in thinking that currently when managed types are subclassed in > python the pyth

[Python.NET] subclassing managed types in python

2013-10-09 Thread Tony Roberts
Hi, am I right in thinking that currently when managed types are subclassed in python the python methods can't override the base class methods when called from .net? It would be useful to be able to do this for something I'm working on at the moment, and before I started looking at it I wondered

Re: [Python.NET] Python 3 version of Python for .NET

2013-07-05 Thread Tony Roberts
Yes, I made some changes to get it working in Python 3 a while ago. The code's on github: https://github.com/tonyroberts/pythonnet. I've tested it with 3.3 x64 and it works ok for me (although I've only really used the 3.2 x64 build extensively). regards, Tony On Fri, Jul 5, 2013 at 3:56 AM, Ky

Re: [Python.NET] Python 3 version of Python for .NET

2013-06-02 Thread Tony Roberts
Hi David, sure, you can get the code from here: https://github.com/tonyroberts/pythonnet and I put some pre-built binaries here: http://www.pyxll.com/pythonnet/ Tony On Mon, Jun 3, 2013 at 5:38 AM, David Lechner wrote: > On 2/28/2013 9:23 AM, Tony Roberts wrote: > >> If someon

Re: [Python.NET] Loading C# DLLs from CPython

2013-03-20 Thread Tony Roberts
Hi Alex, you can import the clr module in the standard cPython interpreter, so I don't think there's any need to use nPython. You just need to make sure that the clr.pyd module is somewhere on your pythonpath. regards, Tony On Wed, Mar 20, 2013 at 4:16 PM, Alex Campbell wrote: > Hi, > > We ne

Re: [Python.NET] Python 3 version of Python for .NET

2013-02-28 Thread Tony Roberts
hing still works the same with older versions of python. cheers, Tony On Tue, Feb 26, 2013 at 6:35 PM, Tribble, Brett wrote: > This is crazy talk! > > ** ** > > *From:* PythonDotNet [mailto:pythondotnet-bounces+btribble= > ea@python.org] *On Behalf Of *Tony Roberts &g

[Python.NET] Python 3 version of Python for .NET

2013-02-26 Thread Tony Roberts
Hi, I've made the necessary changes to the Python for .NET package for it to work with Python 3. What's the best way to get this integrated back into the main project? Can I get access to the svn repo and check it into a branch for peer review and integration? Or should I email someone a patch fi