Re: [IronPython] Embedding Question

2006-08-10 Thread Shri Borde
Another alternative is: ClrModule clr = (ClrModule)engine.Import("clr"); clr.AddReference(typeof(SomeAutoCadType).Assembly); This is similar to doing "engine.LoadAssembly(typeof(SomeAutoCadType).Assembly)", but is more robust since it also updates "clr.References". PythonEngine.LoadAssembly sho

Re: [IronPython] PythonEngine.RunFile

2006-08-10 Thread Shri Borde
__name___ == "__main__": is a convention enforced by ipy.exe. The PythonEngine itself does not directly support this concept. However, you can achieve that result (just like ipy.exe does) by using code like this:   PythonEngine engine = new PythonEngine(); EngineModule module = engine.Cr

Re: [IronPython] Debugging support PythonEngine

2006-08-10 Thread Shri Borde
If EngineOptions.ClrDebuggingEnabled is set, we use AssemblyBuilder, TypeBuilder, etc for PythonEngine.Executed. The code generated by AssemblyBuilder, TypeBuilder, etc supports PDB debug information tracking for the methods, and so you will be able to set breakpoints in the code. However,

Re: [IronPython] PythonEngine.RunFile

2006-08-10 Thread Martin Maly
You can try the PythonEngine.CreateOptimizedModule which you can also pass a name your module should get. Let us know if that doesn’t meet your needs.   Martin   From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Tim Riley Sent: Thursday, August 10, 2006 2:17 PM To: Discus

Re: [IronPython] Embedding Question

2006-08-10 Thread Slide
There is also an Import method on the PythonEngine object that allows you to import stuff programatically as well. On 8/10/06, Kristof Wagemans <[EMAIL PROTECTED]> wrote: > > > > > Isn't engine.LoadAssembly(typeof(SomeAutoCadType).Assembly) > easier or is this different in some way? > > > > _

Re: [IronPython] Embedding Question

2006-08-10 Thread Kristof Wagemans
Isn’t engine.LoadAssembly(typeof(SomeAutoCadType).Assembly) easier or is this different in some way?   From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Dino Viehland Sent: Thursday 10 August 2006 21:17 To: Discussion of IronPython Subject: Re: [IronPython] Embedding

Re: [IronPython] PythonEngine.RunFile

2006-08-10 Thread Tim Riley
I've tested that and I don't think it works with:if __name___ == "__main__":in the python script.Regards,Tim RileyOn 8/10/06, Martin Maly <[EMAIL PROTECTED]> wrote:  Think PythonEngine.ExecuteFile may work for you.   From: [EMAIL PROTECTED] [mailto: [EMAIL PROTECTED]] On Behalf Of

[IronPython] Debugging support PythonEngine

2006-08-10 Thread Kristof Wagemans
I have been experimenting with the debugging support for the PythonEngine. When I use the following code I have several problems.   PythonEngine _pe; EngineOptions options = new EngineOptions(); options.ClrDebuggingEnabled = true; _pe = new PythonEngine(options); _pe.ExecuteFile(@" 

Re: [IronPython] PythonEngine.RunFile

2006-08-10 Thread Martin Maly
 Think PythonEngine.ExecuteFile may work for you.   From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Tim Riley Sent: Thursday, August 10, 2006 1:01 PM To: Discussion of IronPython Subject: [IronPython] PythonEngine.RunFile   In IP version 0.9 there was a PythonEngine.R

Re: [IronPython] Embedding Question

2006-08-10 Thread Tim Riley
Thanks Dino. I had figured that out.On 8/10/06, Dino Viehland <[EMAIL PROTECTED]> wrote: Cool, looks like I was only close though J You may have already imported clr into the default module, but just for the record for those who haven't you'll need an import clr there.  I just realize

[IronPython] PythonEngine.RunFile

2006-08-10 Thread Tim Riley
In IP version 0.9 there was a PythonEngine.RunFile() method, this seems to be gone in 1.0.6. Is there a replacement? ___ users mailing list users@lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com

Re: [IronPython] Embedding Question

2006-08-10 Thread Dino Viehland
Cool, looks like I was only close though J You may have already imported clr into the default module, but just for the record for those who haven’t you’ll need an import clr there.  I just realized I forgot it the 1st time, and I had a redundant “AddReference” in the delegate call.   I’m as

Re: [IronPython] Embedding Question

2006-08-10 Thread Tim Riley
That's exactly what I needed. Thank you Dino.On 8/10/06, Dino Viehland <[EMAIL PROTECTED] > wrote: You can get the assembly object from an AutoCAD type: typeof(Foo).Assembly.  From there you just need to have one helper which will register this in the engine, so you could do:   delega

Re: [IronPython] Embedding Question

2006-08-10 Thread Dino Viehland
You can get the assembly object from an AutoCAD type: typeof(Foo).Assembly.  From there you just need to have one helper which will register this in the engine, so you could do:   delegate void AddReference(object assembly); AddReference adr = engine.CreateMethod(“clr.AddReference(assemb

Re: [IronPython] Embedding Question

2006-08-10 Thread Tim Riley
What I'm trying to do is sort of weird so let me see if I can elaborate further. I am embedding IronPython in a .NET assembly that will later be loaded into AutoCAD. AutoCAD has their own two .NET assemblies that must be referenced, " acmgd.dll" and "acdbmgd.dll". These two assemblies are always lo

Re: [IronPython] Embedding Question

2006-08-10 Thread Dino Viehland
Adding references updates the entire engine, it’s not local to just the current module.  So once you have added a reference you just need to import the namespace into any given module.    Were you also trying to avoid the import statements?   From: [EMAIL PROTECTED] [mailto:[EMAIL PR

[IronPython] Embedding Question

2006-08-10 Thread Tim Riley
If I have an embedded project can I automatically make .NET assemblies referenced in the project available to my python scripts? For example I have two assemblies(not in the GAC) that I have referenced in my project. I would like them always available to all python files run from this program witho

Re: [IronPython] Bug of big integer manipulation

2006-08-10 Thread Martin Maly
As for the infinite loop ... it is a bug in our PowMod code. It is not an actual infinite loop, but we just do the calculation very inefficiently. Filing as a bug also. Martin -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Martin Maly Sent: Thursday, A

Re: [IronPython] Bug of big integer manipulation

2006-08-10 Thread Martin Maly
This is a current limitation of IronPython implementation. I am filing it as a bug for us to seriously investigate. Thanks for your help with the repro! Martin -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of HEMMI, Shigeru Sent: Thursday, August 10, 200

Re: [IronPython] Bug of big integer manipulation

2006-08-10 Thread HEMMI, Shigeru
I wrote: The log file is attached. Sorry, "A non-text attachment was scrubbed..." occured. I resend the attachment file again with .txt extension. C:\NZMATH-0.5.1>dir 2006/08/10 17:28 . 2006/08/10 17:28 .. 2006/08/08 20:42 4,214 CHANGES.txt 2006/08/08 20

Re: [IronPython] Bug of big integer manipulation

2006-08-10 Thread HEMMI, Shigeru
Thanks for the answer. I was able to take a log with -X:ExceptionDetail, but since Japanese, log file includes Japanse characters; I removed them by hand. I was not able to which numbers were involved. The log file is attached. Please note that there are two problems; one is "ValueError: value