Re: [IronPython] New to Ironpython. Want to glue DLL with Python code

2007-08-05 Thread Hugo González Monteverde
Howard R. Hansen wrote: > What type of compiler was used to write the dll? Is it a .net dll or > some other type like unmanaged > C++? Hi Howard (and Michael), The DLL is a proprietary one from the GrFinger SDK package (http://www.griaule.com/page/en-us/grfinger_fingerprint_sdk) so I don't

[IronPython] C# and IronPython

2007-08-05 Thread sms rku
I am very new to Python and IronPython. Could you please let me know if it is possible to Make my application [.exe] that has a static Main method and 3 other public methods defined in a class to be accessed from IronPython script? i.e, Will I be able to create instance of the class from IronPyt

Re: [IronPython] New to Ironpython. Want to glue DLL with Python code

2007-08-05 Thread Howard R. Hansen
What type of compiler was used to write the dll? Is it a .net dll or some other type like unmanaged C++? Howard Hugo González Monteverde wrote: > Hi all, > > I'm new to IronPython, thought I've been using CPython for two years now. > > I am now developing a project using a library for proces

Re: [IronPython] New to Ironpython. Want to glue DLL with Python code

2007-08-05 Thread Michael Foord
Hugo González Monteverde wrote: > [snip..] > > I'm really beginning here, so the question would be: how do I import > classes and functions from a DLL what I know is accessible from a C# > application, using IronPython? > > Thanks for any advice or direction, > Could you show an example of how

[IronPython] New to Ironpython. Want to glue DLL with Python code

2007-08-05 Thread Hugo González Monteverde
Hi all, I'm new to IronPython, thought I've been using CPython for two years now. I am now developing a project using a library for processing Biometrics (fingerprint recognition) and would like to use Python to invoke the functions in the DLL. The DLL comes with C# examples, so I'm assuming h

Re: [IronPython] .NET can see Python classes?

2007-08-05 Thread Michael Foord
Bryan wrote: > On 8/5/07, Michael Foord <[EMAIL PROTECTED]> wrote: > >> Here is a full example: >> [snip...] >> > > this is great news. this is very helpful... thanks. i assume there > is another Execute method that you can pass in a path to file or take > a file object so we don't have t

Re: [IronPython] .NET can see Python classes?

2007-08-05 Thread Bryan
On 8/5/07, Michael Foord <[EMAIL PROTECTED]> wrote: > Here is a full example: > > using System; > using IronPython.Hosting; > using IronPython.Runtime.Types; > using IronPython.Runtime.Operations; > > namespace TestPythonConsole > { > class Program > { > static void Main() >

Re: [IronPython] Compiler error for invalid field access

2007-08-05 Thread Ori - Gmail
Well yes, *somewhere*, but there is a big difference between writing the code and executing it. It is not easy to create and manage the context in my case -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Michael Foord Sent: א 05 אוגוסט 2007 23:11 To: Discus

Re: [IronPython] Compiler error for invalid field access

2007-08-05 Thread Michael Foord
Ori wrote: > Executing the code to know if there is a problem or not is not what I wish > for. I really can't do it because in my case the context does not exist. > I will try to create a 'fake' context in order to run the code, but I'm not > sure it is a good idea.. > > I presume you are execu

Re: [IronPython] Compiler error for invalid field access

2007-08-05 Thread Ori
Executing the code to know if there is a problem or not is not what I wish for. I really can't do it because in my case the context does not exist. I will try to create a 'fake' context in order to run the code, but I'm not sure it is a good idea.. Chip Norkus wrote: > > On Sun Aug 05, 2007; 12

Re: [IronPython] Compiler error for invalid field access

2007-08-05 Thread Chip Norkus
On Sun Aug 05, 2007; 12:51PM -0700, Ori wrote: > > Hello, > > I'm using the following code to compile python code: > > SystemState state = new SystemState(); > MyCompilerSink sink = new MyCompilerSink(); > CompilerContext context = new CompilerContext(string.Empty, sink); > Parser parser = Parse

Re: [IronPython] Compiler error for invalid field access

2007-08-05 Thread Michael Foord
Ori wrote: > Hello, > > I'm using the following code to compile python code: > > SystemState state = new SystemState(); > MyCompilerSink sink = new MyCompilerSink(); > CompilerContext context = new CompilerContext(string.Empty, sink); > Parser parser = Parser.FromString(state, context, "my code");

[IronPython] Compiler error for invalid field access

2007-08-05 Thread Ori
Hello, I'm using the following code to compile python code: SystemState state = new SystemState(); MyCompilerSink sink = new MyCompilerSink(); CompilerContext context = new CompilerContext(string.Empty, sink); Parser parser = Parser.FromString(state, context, "my code"); parser.ParseFileInput();

Re: [IronPython] .NET can see Python classes?

2007-08-05 Thread Michael Foord
Ori wrote: > you can try the following code: > > PythonEngine engine = new PythonEngine(); > EngineModule module = engine.CreateModule(); > engine.Execute(handleCode(code, def), module); # code contains definition > for python class 'PyClass' > UserType ptype = module.Globals["PyClass"] as UserType

Re: [IronPython] .NET can see Python classes?

2007-08-05 Thread Curt Hagenlocher
On 8/5/07, Bryan <[EMAIL PROTECTED]> wrote: > > > i to would like to do this. i don't understand a part of this. i > understand creating a CLR interface and i understand creating a python > file that has a class that derives from the CLR interface. but how > does the CLR code instantiate the der

Re: [IronPython] .NET can see Python classes?

2007-08-05 Thread Bryan
On 8/5/07, Curt Hagenlocher <[EMAIL PROTECTED]> wrote: > On 8/4/07, Darren Govoni <[EMAIL PROTECTED] > wrote: > > The fundamental issue here is that Python classes don't follow the same > semantics as CLR classes. They are, for instance, mutable after > construction in ways that CLR classes are no

Re: [IronPython] .NET can see Python classes?

2007-08-05 Thread John J Lee
On Sun, 5 Aug 2007, Curt Hagenlocher wrote: > On 8/4/07, Darren Govoni <[EMAIL PROTECTED]> wrote: [...] > construction in ways that CLR classes are not. In order to expose a Python > class directly to the CLR, it would have to be "frozen" in some manner, and A metaclass could achieve that. > yo

Re: [IronPython] .NET can see Python classes?

2007-08-05 Thread Darren Govoni
I see. Currently, my python class extends a CLR class, but the python class is not resolvable from CLR. I want a CLR persistence engine to be able to reflect on the python class as if it were a CLR class, but it says it cannot find the MyPython class created in my python script. I guess my python

Re: [IronPython] .NET can see Python classes?

2007-08-05 Thread Curt Hagenlocher
On 8/4/07, Darren Govoni <[EMAIL PROTECTED]> wrote: > >Can .NET see python defined classes or objects? I define a class in > Python > but one of my .NET classes tries to find it via reflection and it cannot. > I saw a post about this that is over a year old saying it was not then > supported. >