Re: [IronPython] TryGetMember is called for methods instead of TryInvokeMember

2010-06-22 Thread Dino Viehland
Calling TryGetMember is actually the correct thing to do. Different languages have different semantics for when you do “a.Foo();” Some languages turn this into an InvokeMember while other languages separate this out into a get and invoke. In Python we separate this out into a get and invoke b

Re: [IronPython] Modules in hosted enviroment

2010-06-22 Thread Dino Viehland
Jeff wrote: > Hi Ross, > It sounds like you want Dino's suggestion IAttributesCollection, which > will give you much more flexibility. I've never done that, but it > looks fairly straightforward. > > > An unrelated issue I have with ScriptScope is I can't figure out to add > > overloaded functions

Re: [IronPython] Modules in hosted enviroment

2010-06-22 Thread Jeff Hardy
Hi Ross, It sounds like you want Dino's suggestion IAttributesCollection, which will give you much more flexibility. I've never done that, but it looks fairly straightforward. > An unrelated issue I have with ScriptScope is I can't figure out to add > overloaded functions with different parameter

Re: [IronPython] NLTK site-module in C# app?

2010-06-22 Thread Jeff Hardy
On Tue, Jun 22, 2010 at 2:47 PM, William Johnston wrote: > However, I am having difficulties finding your zlib dll from the DLLs > directory. I assume this is from a hosting application, correct? All you'll need to do is load the assembly from disk, and then load it into the engine: Assembl

Re: [IronPython] NLTK site-module in C# app?

2010-06-22 Thread William Johnston
Mr. Hardy: Thanks for your input. However, I am having difficulties finding your zlib dll from the DLLs directory. Could you also assist me on this? Thanks, William Johnston -Original Message- From: users-boun...@lists.ironpython.com [mailto:users-boun...@lists.ironpython.com] On Be

Re: [IronPython] NLTK site-module in C# app?

2010-06-22 Thread Jeff Hardy
On Tue, Jun 22, 2010 at 1:29 PM, William Johnston wrote: > How do I include site-modules in embedded Python C# apps? You probably want to use ScriptEngine.SetSearchPaths. It's equivalent to setting sys.path. - Jeff ___ Users mailing list Users@lists.ir

[IronPython] NLTK site-module in C# app?

2010-06-22 Thread William Johnston
Hello, I can now import the NLTK from ipy.exe, but not from a C# application. How do I include site-modules in embedded Python C# apps? Thanks. ___ Users mailing list Users@lists.ironpython.com http://lists.ironpython.com/listinfo.cg

[IronPython] changes in COM access from IronPython 1.1

2010-06-22 Thread Ernesto Cullen
hi all, we have a problem with a project after updating it to IPy 2.6.1. We need to use a COM library; we add the reference in VS which creates the interop.XXX file. In IPy v1.1 we could access the imported types directly, like LN_AclEntry = LN_dbACL.GetEntry(entryName) if (LN_AclEntry =

[IronPython] TryGetMember is called for methods instead of TryInvokeMember

2010-06-22 Thread Marcus Carvalho
I have an application that passes a DynamicObject to an IronPython script. The class works perfectly in C# but when a method is invoked inside a IronPython script the TryGetMember is called instead of TryInvokeMember and if I try to return a value through TryGetMember I get an exception saying that

Re: [IronPython] Modules in hosted enviroment

2010-06-22 Thread Ross Hammermeister
You are correct about what I'm trying to do, sorry if wrote it in a way that was hard to understand. The project I'm working on this for is a 2-D game engine. I plan on calling python functions from C# with the relevant class (say on a collision with the colliding objects as parameters) but i

[IronPython] -X:PassExceptions

2010-06-22 Thread Kuno Meyer
Hi all In order to see the full stack traces, I'd like to have -X:PassExceptions set for all my scripts. Is there a way to set this from *inside* a running script? Thanks Kuno ___ Users mailing list Users@lists.ironpython.com http://lists.ironpython

Re: [IronPython] Modules in hosted enviroment

2010-06-22 Thread Dino Viehland
Alternately you could implement IAttributesCollection and execute the Python code against a scope which is backed by the IAC. This would let you lazily provide the values to the script on-demand. If you have a fixed set of members I like Jeff's suggestion more but this is good if the members are

Re: [IronPython] Modules in hosted enviroment

2010-06-22 Thread Jeff Hardy
Hi Ross, Sorry if I'm being dense, but here's how I understand what you're doing: - you're hosting IronPython in some program X - X will generate data D and somehow feed D to Python script Y - Y will transform or process D in some way What you're looking for is the best way to get D into Y, corre

Re: [IronPython] Modules in hosted enviroment

2010-06-22 Thread Ross Hammermeister
My program creates data for a python script to use and I though the best way for it get access to this was with modules. Simply setting a variable in the script would not work because of the complexity of the data. Using the clr module will not get access to the existing data (I also do not want