Re: [Python.NET] Some super basic/possibly stupid question

2010-07-13 Thread Dave
e information. >>> import System Traceback (most recent call last): File "", line 1, in ImportError: No module named System >>> import clr >>> import System >>> System >>> NB: You should have copied the clr.pyd and Pytho

Re: [Python.NET] Selecting an overloaded constructor + a MethodBinder.Bind patch

2010-07-28 Thread Dave
if you've seen this but in the spirit of posting patches I thought I'd mention Alexey Borzenkov's patch: http://git.kitsu.ru/patched/pythonnet.git?a=commitdiff;h=995109e3ed27d6061dde5376f2968c9fbad894b7 Which fixes the problem of errors in constructors not being passed through to Python

[Python.NET] This assembly is built by a runtime newer than t he currently loaded runtime

2010-08-17 Thread Dave
NET4 version: %windir%\Microsoft.NET\Framework\v4.0.30319\ilasm /nologo /quiet /dll %ILASM_EXTRA_ARGS% /include=%INCLUDE_PATH% /output=%OUTPUT_PATH% %INPUT_PATH% ...and everything works perfectly! HTH, Dave NB: Apologies if this appears twice - I sent it from a different account previously and d

Re: [Python.NET] Problem debugging to python.runtime.dll

2010-02-18 Thread Dave Hirschfeld
t the breakpoint you set in the function called by the Python script. HTH, Dave -- View this message in context: http://old.nabble.com/Problem-debugging-to-python.runtime.dll-tp27644956p27645311.html Sent from the Python - pythondotnet mailing list archive at Nabble.com. ___

Re: [Python.NET] how can I build an assembly I can AddReference()?

2010-05-28 Thread Dave Hirschfeld
h? e.g. clr.AddReference(r'C:\temp\PythonDotNET\FactoryPattern') If that doesn't work does using Assembly.LoadFile work? e.g. from clr import System from System import Reflection full_filename = r'C:\temp\PythonDotNET\FactoryPattern.dll' Reflection.Assembly.LoadFile(full_filename) HTH, Dave _ Python.NET mailing list - PythonDotNet@python.org http://mail.python.org/mailman/listinfo/pythondotnet

Re: [Python.NET] getting started - can't import a simple dll

2010-12-15 Thread Dave Hirschfeld
s in it? > I managed to compile Python.NET for .NET 4 with only a couple of minor modifications to the code: http://thread.gmane.org/gmane.comp.python.dotnet/969 NB: I put both clr.pyd and Python.Runtime.dll in my python root dir (C:\Python26) HTH, Dave

Re: [Python.NET] Python for .NET with PythonXY ?

2011-05-17 Thread Dave Hirschfeld
0.10.2 -- An enhanced Interactive Python. ? -> Introduction and overview of IPython's features. %quickref -> Quick reference. help -> Python's own help system. object? -> Details about 'object'. ?object also works, ?? prints more. IPython p

Re: [Python.NET] Replaced Python.exe file causes problems for extension modules

2011-07-11 Thread Dave Hirschfeld
.NET4 version of ilasm - see: http://permalink.gmane.org/gmane.comp.python.dotnet/970 I don't know that copying over the newly compiled python.exe will work (possibly for the reasons you state) however simply copying over the clr.pyd and Python.Runtime.dll to your C:\Python26 directory should work

Re: [Python.NET] using Python.NET with .NET4/VS2010 in Python 2.7

2012-08-08 Thread Dave Hirschfeld
#x27;ll see under "Conditional compilation symbols" PYTHON25,UCS2 or similar. To target Python 2.7 simply change that to PYTHON27,UCS2 HTH, Dave _ Python.NET mailing list - PythonDotNet@python.org http://mail.python.org/mailman/listinfo/pythondotnet

[Python.NET] Efficient copy of .NET Array to ctypes or numpy array.

2014-05-21 Thread Dave Cook
style byte string would allow numpy.fromstring() to be used for creating the numpy array. (I see a similar question went unanswered on the list in August 2011, but I was hoping someone may have figured it out by now.) Thanks, Dave Cook _ Python.NET

[Python.NET] Efficient copy of .NET Array to ctypes or numpy array.

2014-05-23 Thread Dave Cook
_hndl = GCHandle.Alloc(src, GCHandleType.Pinned) try: src_ptr = src_hndl.AddrOfPinnedObject().ToInt32() bufType = ctypes.c_double*len(src) cbuf = bufType.from_address(src_ptr) dest = np.frombuffer(cbuf, dtype=cbuf._type_) finally: if src_hndl.IsAllocated: src_hndl.Free() Dave

Re: [Python.NET] converting double array to numpy list

2014-08-23 Thread Dave Cook
l.Copy: def ndarray_ptr(a):'''Return a .NET pointer to the underlying ndarray data.'''return IntPtr.__overloads__[int](a.__array_interface__['data'][0])def marshal_to_ndarray(src):n = len(src)dest = np.empty(n, dtype='f8') Marsha

[Python.NET] keyword arguments

2015-09-03 Thread Dave Hirschfeld
It doesn't look like it's supported to instantiate a C# class from Python using keyword arguments? Is that the case or am I missing something. If it's not supported would it theoretically be possible and if so how difficult would it be to implement?

Re: [Python.NET] keyword arguments

2015-09-08 Thread Dave Hirschfeld
Denis Akhiyarov writes: > > > Hi Dave, > Can you please file an issue on github? I think keyword args is important functionality since the call signature is not visible from Python to c# and vice versa unlike IronPython. Does this work on IronPython? > github.com/pythonnet &

[Python.NET] Infinity Handling

2015-09-08 Thread Dave Hirschfeld
It seems that there's no way to pass an infinity from Python to C#? Is that correct, or am I missing something? In case the former is correct I've filed an enhancement request issue on github: https://github.com/pythonnet/pythonnet/issues/100 Th