From kfarmer at thuban.org Sat Oct 1 06:05:57 2005 From: kfarmer at thuban.org (Keith J. Farmer) Date: Fri, 30 Sep 2005 21:05:57 -0700 Subject: [IronPython] [IP 0.9.2] Mono 1.1.9.1 weirdness Message-ID: Has someone checked 1.1.9.1 with IronPython 0.9.2? Under Mono, it's emitting a character on each key-down/key-up event, and isn't holding control. See the following: .NET 2.0b2: (bat) IronPythonConsole -X:TabCompletion -X:ColorfulConsole IronPython 0.9.2 on .NET 2.0.50215.44 Copyright (c) Microsoft Corporation. All rights reserved. >>> ^Z Mono 1.1.9.1: (bat) mono "%IRONPYTHON_HOME%\IronPythonConsole.exe" -X:TabCompletion -X:ColorfulConsole IronPython 0.9.2 on .NET 2.0.50215.16 Copyright (c) Microsoft Corporation. All rights reserved. >>> ^?^Z^Z^? Traceback (most recent call last): in <0x00029> IronPython.Hosting.PythonEngine:ParseText (System.String text, Boolean endOfInput) in <0x000ab> IronPython.AST.Parser:parseStmt () in <0x0002a> IronPython.AST.Parser:parseSimpleStmt () in <0x00272> IronPython.AST.Parser:parseSmallStmt () in <0x0005d> IronPython.AST.Parser:parseExprStmt () in <0x0002d> IronPython.AST.Parser:parseTestListAsExpr () in <0x0005f> IronPython.AST.Parser:parseTestList (System.BooleantrailingComma) in <0x0003d> IronPython.AST.Parser:parseTest () in <0x00013> IronPython.AST.Parser:parseAndTest () in <0x00069> IronPython.AST.Parser:parseNotTest () in <0x00023> IronPython.AST.Parser:parseComparison () in <0x0000c> IronPython.AST.Parser:parseExpr () in <0x0002a> IronPython.AST.Parser:parseExpr (Int32 precedence) in <0x0010d> IronPython.AST.Parser:parseFactor () in <0x00013> IronPython.AST.Parser:parsePower () in <0x00180> IronPython.AST.Parser:parsePrimary () SyntaxError: unexpected token bad character ' ' at :1 >>> () >>> Mono 1.1.9.1: (command line) mono "%IRONPYTHON_HOME%\IronPythonConsole.exe" -X:TabCompletion -X:ColorfulConsole Traceback (most recent call last): in <0x0008e> IronPythonConsole.PythonCommandLine:RunFile(IronPython.Hosting.Pyt honEngine engine, System.String filename) in <0x00012> IronPython.Hosting.PythonEngine:RunFileInNewModule(System.String fileName) in <0x00030> IronPython.Hosting.PythonEngine:RunFileInNewModule(System.String fileName, System.String moduleName) in <0x0001c> IronPython.AST.Parser:fromFile (System.String filename) in <0x00021> System.IO.File:OpenRead (System.String path) in (wrapper remoting-invoke-with-check) System.IO.FileStream:.ctor(string,System.IO.FileMode,System.IO.FileAcces s,System.IO.FileShare) in <0x0001f> System.IO.FileStream:.ctor (System.String name, FileMode mode, File Access access, FileShare share) in <0x000ed> System.IO.FileStream:.ctor (System.String name, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, Boolean isAsync, Boolean anonymous) in <0x0005e> System.IO.Directory:Exists (System.String path) System.IO.IOException: Win32 IO returned ERROR_INVALID_NAME. Path: -X: Mono 1.1.9.1: (command line) mono "%IRONPYTHON_HOME%\IronPythonConsole.exe" [10] # > mono IronPythonConsole.exe IronPython 0.9.2 on .NET 2.0.50215.16 Copyright (c) Microsoft Corporation. All rights reserved. >>> ^Z ----- Keith J. Farmer // kfarmer at thuban.org From riltim at gmail.com Mon Oct 3 19:38:18 2005 From: riltim at gmail.com (Tim Riley) Date: Mon, 3 Oct 2005 13:38:18 -0400 Subject: [IronPython] Embedded IronPython 0.9.2, AutoCAD 2005 and Security. Message-ID: Disclaimer: I'm fairly new to C# and .NET in general. Using IronPython 0.9.2. on .NET 2.0.50.215.44 w/ SharpDevelop 2.0.0 build 408 I've been trying to use a modified version of the supplied Embed4.cs example to run from within AutoCAD (just to see if I can get it to work). It compiles fine but when I load and run it I get the exception listed below. I tried "caspol -m -af c:\path\to\IronPython.dll" but it errors out saying IronPython.dll is not strong named. Do I need to recompile IronPython.dll or am I heading in the wrong direction all together? Any help/tips would be greatly appreciated. Regards, Tim Riley [Exception] ************** Exception Text ************** System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.TypeInitializationException: The type initializer for 'IronPython.AST.SnippetMaker' threw an exception. ---> System.Security.Policy.PolicyException: Execution permission cannot be acquired. at System.AppDomain.nCreateDynamicAssembly(AssemblyName name, Evidence identity, StackCrawlMark& stackMark, PermissionSet requiredPermissions, PermissionSet optionalPermissions, PermissionSet refusedPermissions, AssemblyBuilderAccess access) at System.AppDomain.InternalDefineDynamicAssembly(AssemblyName name, AssemblyBuilderAccess access, String dir, Evidence evidence, PermissionSet requiredPermissions, PermissionSet optionalPermissions, PermissionSet refusedPermissions, StackCrawlMark& stackMark) at System.AppDomain.DefineDynamicAssembly(AssemblyName name, AssemblyBuilderAccess access, String dir, Evidence evidence) at IronPython.AST.AssemblyGen..ctor(String sourceFileName, String moduleName, String outDir, String outFile) at IronPython.AST.AssemblyGen..ctor(String source, String module, String output) at IronPython.AST.SnippetMaker..cctor() --- End of inner exception stack trace --- at IronPython.Hosting.PythonEngine..ctor() at IPTest.EmbededExample.pythontest() in c:\Documents and Settings\TJRiley\My Documents\SharpDevelop Projects\AcadHelloWorld\MyClass.cs:line 18 at IronPython.Hosting.PythonEngine..ctor() at IPTest.EmbededExample.pythontest() in c:\Documents and Settings\TJRiley\My Documents\SharpDevelop Projects\AcadHelloWorld\MyClass.cs:line 18 at IronPython.Hosting.PythonEngine..ctor() at IPTest.EmbededExample.pythontest() in c:\Documents and Settings\TJRiley\My Documents\SharpDevelop Projects\AcadHelloWorld\MyClass.cs:line 18 at IronPython.Hosting.PythonEngine..ctor() at IPTest.EmbededExample.pythontest() in c:\Documents and Settings\TJRiley\My Documents\SharpDevelop Projects\AcadHelloWorld\MyClass.cs:line 18 at IronPython.Hosting.PythonEngine..ctor() at IPTest.EmbededExample.pythontest() in c:\Documents and Settings\TJRiley\My Documents\SharpDevelop Projects\AcadHelloWorld\MyClass.cs:line 18 at IronPython.Hosting.PythonEngine..ctor() at IPTest.EmbededExample.pythontest() in c:\Documents and Settings\TJRiley\My Documents\SharpDevelop Projects\AcadHelloWorld\MyClass.cs:line 18 --- End of inner exception stack trace --- at System.RuntimeMethodHandle._InvokeMethodFast(Object target, Object[] arguments, SignatureStruct& sig, MethodAttributes methodAttributes, RuntimeTypeHandle typeOwner) at System.RuntimeMethodHandle.InvokeMethodFast(Object target, Object[] arguments, SignatureStruct sig, MethodAttributes methodAttributes, RuntimeTypeHandle typeOwner) at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture, Boolean skipVisibilityChecks) at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture) at AcMgPerDocumentCommandClass.Invoke(AcMgPerDocumentCommandClass* , gcroot* mi) at AcMgCommandClass.CommandThunk.Invoke(CommandThunk* ) [/Exception] [Code] using System; using System.Collections; using System.Windows.Forms; using Autodesk.AutoCAD.ApplicationServices; using Autodesk.AutoCAD.DatabaseServices; using Autodesk.AutoCAD.Runtime; using IronPython.Hosting; namespace IPTest { public class EmbededExample { [CommandMethod("pytest")] public void pythontest() { PythonEngine engine = new PythonEngine(); Form form = new Form(); engine.SetVariable("form", form); string command = // // Import Windows.Forms // "import sys " + "sys.LoadAssemblyByName('System.Windows.Forms') " + "sys.LoadAssemblyByName('System.Drawing') " + "from System.Windows.Forms import Application, Button " + "from System.Drawing import Point " + // // Create button and add it into the form created by the C# code // "b = Button(Text='Exit') " + "form.Controls.Add(b) " + "b.Location = Point(100, 100) " + // // Setup an event handler for button's Click event // "def on_exit(*args): " + " Application.Exit() " + "b.Click += on_exit " + // // Display the form // "form.Text = 'Embedding' " + "form.Show() " + "Application.Run() "; engine.Execute(command); } } } [/Code] -------------- next part -------------- An HTML attachment was scrubbed... URL: From bloggingbrian at gmail.com Mon Oct 3 22:26:37 2005 From: bloggingbrian at gmail.com (Brian Tyler) Date: Mon, 3 Oct 2005 15:26:37 -0500 Subject: [IronPython] Embedded IronPython 0.9.2, AutoCAD 2005 and Security. Message-ID: <6331c1a0510031326j5f2a5eadgd0477b30beaa65c1@mail.gmail.com> I ran into the same problem using our product (LabVIEW) but the fix is fairly simple - go into AssemblyGen.cs of the IronPython assembly and delete the last parameter (domain.Evidence) of the two DefineDynamicAssembly() methods. The problem comes up when you try to host the IronPython engine inside any AppDomain other than the DefaultDomain (as I assume you are doing in AutoCAD, we are doing in LabVIEW and as you would find if you tried ASP.NET). The most common way to create a new AppDomain is with null evidence, because you typically rely on the assembly evidence to handle CAS (as you were trying to do with caspol). Even if you do domain.Evidence when creating your own AppDomain, you still get null - there is something about the DefaultDomain that we are not inheriting. If you read the docs on DefineDynamicAssembly(), you'll see that only fully trusted callers can supply evidence - and somehow we are not...I'm still trying to figure out what's the special invocation to make it work with the evidence, but so far I've only found one way - create your own evidence when creating your AppDomain and add MyComputer as the Zone. I'm not about to ship that code as it seems to break just about every part of CAS, but it is a clue... Brian -------------- next part -------------- An HTML attachment was scrubbed... URL: From riltim at gmail.com Mon Oct 3 22:44:40 2005 From: riltim at gmail.com (Tim Riley) Date: Mon, 3 Oct 2005 16:44:40 -0400 Subject: [IronPython] Embedded IronPython 0.9.2, AutoCAD 2005 and Security. In-Reply-To: <6331c1a0510031326j5f2a5eadgd0477b30beaa65c1@mail.gmail.com> References: <6331c1a0510031326j5f2a5eadgd0477b30beaa65c1@mail.gmail.com> Message-ID: Brian: That worked great. Thank you very much. Tim Riley On 10/3/05, Brian Tyler wrote: > > I ran into the same problem using our product (LabVIEW) but the fix is > fairly simple - go into AssemblyGen.cs of the IronPython assembly and > delete the last parameter (domain.Evidence) of the two > DefineDynamicAssembly() methods. > > The problem comes up when you try to host the IronPython engine inside any > AppDomain other than the DefaultDomain (as I assume you are doing in > AutoCAD, we are doing in LabVIEW and as you would find if you tried > ASP.NET ). The most common way to create a new AppDomain > is with null evidence, because you typically rely on the assembly evidence > to handle CAS (as you were trying to do with caspol). Even if you do > domain.Evidence when creating your own AppDomain, you still get null - > there is something about the DefaultDomain that we are not inheriting. > > If you read the docs on DefineDynamicAssembly(), you'll see that only > fully trusted callers can supply evidence - and somehow we are not...I'm > still trying to figure out what's the special invocation to make it work > with the evidence, but so far I've only found one way - create your own > evidence when creating your AppDomain and add MyComputer as the Zone. I'm > not about to ship that code as it seems to break just about every part of > CAS, but it is a clue... > > Brian > > > _______________________________________________ > users-ironpython.com mailing list > users-ironpython.com at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From daftspaniel at gmail.com Tue Oct 4 20:30:41 2005 From: daftspaniel at gmail.com (Davy Mitchell) Date: Tue, 4 Oct 2005 19:30:41 +0100 Subject: [IronPython] Accessing Win Form Properties Message-ID: <20253b0c0510041130n20058b7fwa5e5a78de9640407@mail.gmail.com> Hi Folks, Apologies if this is a FAQ but I couldn't find anything in the archives. I am writing a GUI Designer in IronPython. print Form.Text I am probably missing something simple but how do I get the actual text/value of the property. Thanks, Davy Mitchell http://www.latedecember.com From Martin.Maly at microsoft.com Tue Oct 4 21:11:06 2005 From: Martin.Maly at microsoft.com (Martin Maly) Date: Tue, 4 Oct 2005 12:11:06 -0700 Subject: [IronPython] Accessing Win Form Properties In-Reply-To: <20253b0c0510041130n20058b7fwa5e5a78de9640407@mail.gmail.com> Message-ID: <1DFB396200705E46B5338CA4B2E25BDE97562E@DF-BANDIT-MSG.exchange.corp.microsoft.com> I suspect that the "Form" you are referencing is the System.Windows.Forms.Form class. Once you have instance, it should just work: f = Form() f.Text = "Hi" print f.Text I hope this helps Martin -----Original Message----- From: users-ironpython.com-bounces at lists.ironpython.com [mailto:users-ironpython.com-bounces at lists.ironpython.com] On Behalf Of Davy Mitchell Sent: Tuesday, October 04, 2005 11:31 AM To: users-ironpython.com at lists.ironpython.com Subject: [IronPython] Accessing Win Form Properties Hi Folks, Apologies if this is a FAQ but I couldn't find anything in the archives. I am writing a GUI Designer in IronPython. print Form.Text I am probably missing something simple but how do I get the actual text/value of the property. Thanks, Davy Mitchell http://www.latedecember.com _______________________________________________ users-ironpython.com mailing list users-ironpython.com at lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com From s.kobalczyk at softwaremind.pl Tue Oct 4 21:26:14 2005 From: s.kobalczyk at softwaremind.pl (Szymon Kobalczyk) Date: Tue, 04 Oct 2005 21:26:14 +0200 Subject: [IronPython] Error when using Options.FastEval Message-ID: <4342D756.2090801@softwaremind.pl> Hi, Few days ago I wrote about a problem with Options.FastEval. I noticed today that accidentally it was posted as replay to some other topic and I'm not sure that anyone has seen it. So here it is again: --- Last time I wrote here I was concerned with memory consumption and performance of embedding IronPython. I decided then to use the FastEval option. I think I found some error in this mode. In code below the last line would throw "Key not found in dictionary." exception caused by the "None" term. When you don't use the FastEval the code runs properly. static void Main(string[] args) { IronPython.AST.Options.FastEval = true; IronPython.AST.Options.DoNotSaveBinaries = true; PythonEngine engine = new PythonEngine(); engine.SetVariable("item", null); object value = engine.Evaluate("item == None"); } Also, could you please explain what exactly are the differences between the two modes. Szymon Kobalczyk. PS: Just found that it also doesn't work for the "str" builtin function but didn't have time to try others. From daftspaniel at gmail.com Tue Oct 4 21:47:51 2005 From: daftspaniel at gmail.com (Davy Mitchell) Date: Tue, 4 Oct 2005 20:47:51 +0100 Subject: [IronPython] Accessing Win Form Properties In-Reply-To: <1DFB396200705E46B5338CA4B2E25BDE97562E@DF-BANDIT-MSG.exchange.corp.microsoft.com> References: <20253b0c0510041130n20058b7fwa5e5a78de9640407@mail.gmail.com> <1DFB396200705E46B5338CA4B2E25BDE97562E@DF-BANDIT-MSG.exchange.corp.microsoft.com> Message-ID: <20253b0c0510041247if33a234sab6746260c1bd5cb@mail.gmail.com> Thanks Martin - I was mixing up the instance name. Too busy looking at the output than my own code :-) Regards, Davy On 10/4/05, Martin Maly wrote: > I suspect that the "Form" you are referencing is the > System.Windows.Forms.Form class. > Once you have instance, it should just work: > > f = Form() > f.Text = "Hi" > print f.Text > > I hope this helps > Martin > > -----Original Message----- > From: users-ironpython.com-bounces at lists.ironpython.com > [mailto:users-ironpython.com-bounces at lists.ironpython.com] On Behalf Of > Davy Mitchell > Sent: Tuesday, October 04, 2005 11:31 AM > To: users-ironpython.com at lists.ironpython.com > Subject: [IronPython] Accessing Win Form Properties > > Hi Folks, > > Apologies if this is a FAQ but I couldn't find anything in the archives. > > I am writing a GUI Designer in IronPython. > print Form.Text > > > I am probably missing something simple but how do I get the actual > text/value of the property. > > Thanks, > Davy Mitchell > > http://www.latedecember.com > _______________________________________________ > users-ironpython.com mailing list > users-ironpython.com at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > -- Davy Mitchell http://www.latedecember.com From Martin.Maly at microsoft.com Tue Oct 4 23:13:50 2005 From: Martin.Maly at microsoft.com (Martin Maly) Date: Tue, 4 Oct 2005 14:13:50 -0700 Subject: [IronPython] Error when using Options.FastEval In-Reply-To: <4342D756.2090801@softwaremind.pl> Message-ID: <1DFB396200705E46B5338CA4B2E25BDE9756AB@DF-BANDIT-MSG.exchange.corp.microsoft.com> Hi Szymon, Sorry for delayed response. The exact difference between the two modes is that FastEval does not generate IL to be executed. Instead, it walks the abstract syntax tree and evaluates the expressions directly. The reason you are seeing the error is that the name resolution for the expression evaluator doesn't consider built-in names (str, int, None, ...). There may be bugs beyond this simple one, but after getting the name resolution to consider built-in names, referencing "str", "None" and the like does work. I am going to include the fix in the 0.9.3 release. Martin -----Original Message----- From: users-ironpython.com-bounces at lists.ironpython.com [mailto:users-ironpython.com-bounces at lists.ironpython.com] On Behalf Of Szymon Kobalczyk Sent: Tuesday, October 04, 2005 12:26 PM To: users-ironpython.com at lists.ironpython.com Subject: [IronPython] Error when using Options.FastEval Hi, Few days ago I wrote about a problem with Options.FastEval. I noticed today that accidentally it was posted as replay to some other topic and I'm not sure that anyone has seen it. So here it is again: --- Last time I wrote here I was concerned with memory consumption and performance of embedding IronPython. I decided then to use the FastEval option. I think I found some error in this mode. In code below the last line would throw "Key not found in dictionary." exception caused by the "None" term. When you don't use the FastEval the code runs properly. static void Main(string[] args) { IronPython.AST.Options.FastEval = true; IronPython.AST.Options.DoNotSaveBinaries = true; PythonEngine engine = new PythonEngine(); engine.SetVariable("item", null); object value = engine.Evaluate("item == None"); } Also, could you please explain what exactly are the differences between the two modes. Szymon Kobalczyk. PS: Just found that it also doesn't work for the "str" builtin function but didn't have time to try others. _______________________________________________ users-ironpython.com mailing list users-ironpython.com at lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com From me at mikerobin.com Tue Oct 11 19:58:13 2005 From: me at mikerobin.com (Michael Robin) Date: Tue, 11 Oct 2005 10:58:13 -0700 Subject: [IronPython] devenv Message-ID: <000401c5ce8d$7665c9a0$0a7ba8c0@MikeRoHP> Thanks for this most-needed project. Is there a Visual Studio plug-in for IP for colorizing, debugging, completion, etc? (Or hooks into other IDEs?) (I saw the message on launching the CLR debugger - but one-stop shopping is nice.) Are most current uses of IP: (a) stand-alone, (b) inside-out (IP as "main" and controller for existing non-IP objects), or (c) outside-in (C# main embedding IP as scripting language)? (Of course, your view of "in" and "out" may vary depending on perspective.) Thanks, m -------------- next part -------------- An HTML attachment was scrubbed... URL: From patrick.haener at btopenworld.com Sat Oct 1 22:47:10 2005 From: patrick.haener at btopenworld.com (Patrick Haener) Date: Sat, 1 Oct 2005 21:47:10 +0100 (BST) Subject: [IronPython] Creating PythonEngine in VB6 Message-ID: <20051001204710.119.qmail@web86507.mail.ukl.yahoo.com> Hi, I am trying to use IronPython to script .Net classes with VB6 from within Excel. The VB6 function below should create a Python engine, but throws a runtime error 80131604. Thanks Patrick Function NewIronPythonInterpreter() As IronPython.PythonEngine Dim rt As New mscoree.CorRuntimeHost rt.Start Dim unk As IUnknown rt.GetDefaultDomain unk Dim ad As AppDomain Set ad = unk ' creating a BasicConsole object works Dim x As IronPython.BasicConsole Set x = ad.CreateInstanceFrom(IronPythonAssembly, "IronPython.Hosting.BasicConsole").Unwrap Dim r As IronPython.PythonEngine ' Creating a Python engine generates a Runtime error # 80131604 Set r = ad.CreateInstanceFrom(IronPythonAssembly, "IronPython.Hosting.PythonEngine").Unwrap Set NewIronPyt -------------- next part -------------- An HTML attachment was scrubbed... URL: From Martin.Maly at microsoft.com Wed Oct 12 06:23:07 2005 From: Martin.Maly at microsoft.com (Martin Maly) Date: Tue, 11 Oct 2005 21:23:07 -0700 Subject: [IronPython] devenv In-Reply-To: <000401c5ce8d$7665c9a0$0a7ba8c0@MikeRoHP> Message-ID: <1DFB396200705E46B5338CA4B2E25BDE9E78CA@DF-BANDIT-MSG.exchange.corp.microsoft.com> I don't think there is any VS plug-in for IronPython for syntax coloring, debugging support, intellisense etc. However I know of few people using xemacs with the extension "python-mode.el". I think it does support syntax coloring but I am not sure whether it goes beyond that. As for the uses of IronPython, it is used in all of the ways you list. If there is a pre-dominant one or not, I am not certain. Few months ago the focus was on the b) - using IronPython to communicate with .Net objects. Many people also embedded IronPython and used it as a scripting engine for their applications. As for the standalone use, my feeling is that to fully enable the scenario, we need to run many more standard Python modules. We are getting there though I hope this helps. Martin ________________________________ From: users-ironpython.com-bounces at lists.ironpython.com [mailto:users-ironpython.com-bounces at lists.ironpython.com] On Behalf Of Michael Robin Sent: Tuesday, October 11, 2005 10:58 AM To: users-ironpython.com at lists.ironpython.com Subject: [IronPython] devenv Thanks for this most-needed project... Is there a Visual Studio plug-in for IP for colorizing, debugging, completion, etc? (Or hooks into other IDEs?) (I saw the message on launching the CLR debugger - but one-stop shopping is nice...) Are most current uses of IP: (a) stand-alone, (b) inside-out (IP as "main" and controller for existing non-IP objects), or (c) outside-in (C# main embedding IP as scripting language)AN>? (Of course, your view of "in" and "out" may vary depending on perspective...) Thanks, m -------------- next part -------------- An HTML attachment was scrubbed... URL: From kfarmer at thuban.org Wed Oct 12 06:54:01 2005 From: kfarmer at thuban.org (Keith J. Farmer) Date: Tue, 11 Oct 2005 21:54:01 -0700 Subject: [IronPython] devenv Message-ID: Idea of how long until parity levels with CPython and the standard library are reached? ----- Keith J. Farmer kfarmer at thuban.org ________________________________ From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Martin Maly Sent: Tuesday, 11 October 2005 21:23 also embedded IronPython and used it as a scripting engine for their applications. As for the standalone use, my feeling is that to fully enable the scenario, we need to run many more standard Python modules. We are getting there -------------- next part -------------- An HTML attachment was scrubbed... URL: From Martin.Maly at microsoft.com Wed Oct 12 06:58:09 2005 From: Martin.Maly at microsoft.com (Martin Maly) Date: Tue, 11 Oct 2005 21:58:09 -0700 Subject: [IronPython] devenv In-Reply-To: Message-ID: <1DFB396200705E46B5338CA4B2E25BDE9E78CD@DF-BANDIT-MSG.exchange.corp.microsoft.com> We are hoping to be very close by the end of the year... Martin ________________________________ From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Keith J. Farmer Sent: Tuesday, October 11, 2005 9:54 PM To: Discussion of IronPython Subject: Re: [IronPython] devenv Idea of how long until parity levels with CPython and the standard library are reached? > ----- Keith J. Farmer kfarmer at thuban.org ________________________________ From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Martin Maly Sent: Tuesday, 11 October 2005 21:23 also embedded IronPython and used it as a scripting engine for their applications. As for the standalone use, my feeling is that to fully enable the scenario, we need to run many more standard Python modules. We are getting there -------------- next part -------------- An HTML attachment was scrubbed... URL: From jvm_cop at spamcop.net Wed Oct 12 17:39:20 2005 From: jvm_cop at spamcop.net (J. Merrill) Date: Wed, 12 Oct 2005 11:39:20 -0400 Subject: [IronPython] Creating PythonEngine in VB6 In-Reply-To: <20051001204710.119.qmail@web86507.mail.ukl.yahoo.com> Message-ID: <4.3.2.7.2.20051012113127.04f6b970@mail.comcast.net> If you have more than one version of .Net installed, it could be that the "wrong" version has been started. This article discusses getting that same error code: http://weblogs.asp.net/cschittko/archive/2005/04/05.aspx and points to this MSDN article that shows how you could use an application configuration file (for your VB6 app, presumably) to require the .Net version used by IronPython: http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpguide/html/cpcontargetingnetframeworkversion.asp Good luck... At 04:47 PM 10/1/2005, Patrick Haener wrote >Hi, >I am trying to use IronPython to script .Net classes with VB6 from within Excel. >The VB6 function below should create a Python engine, but throws a runtime error 80131604. >Thanks >Patrick > >Function NewIronPythonInterpreter() As IronPython.PythonEngine >Dim rt As New mscoree.CorRuntimeHost >rt.Start >Dim unk As IUnknown >rt.GetDefaultDomain unk >Dim ad As AppDomain >Set ad = unk >' creating a BasicConsole object works >Dim x As IronPython.BasicConsole >Set x = ad.CreateInstanceFrom(IronPythonAssembly, "IronPython.Hosting.BasicConsole").Unwrap >Dim r As IronPython.PythonEngine >' Creating a Python engine generates a Runtime error # 80131604 >Set r = ad.CreateInstanceFrom(IronPythonAssembly, "IronPython.Hosting.PythonEngine").Unwrap >Set NewIronPyt J. Merrill / Analytical Software Corp From trimbo at gmail.com Wed Oct 12 18:51:37 2005 From: trimbo at gmail.com (Chris Trimble) Date: Wed, 12 Oct 2005 09:51:37 -0700 Subject: [IronPython] CPython 25x faster than IronPython on this code Message-ID: This same program in interpreted C# or Java (as opposed to JITed) runs about the same speed as CPython (~110ms on my machine). IronPython takes almost 3 seconds in the inner loops. Any ideas why? IronPy version: ------------------------ import System kTotalReps = 800 kNumReps = 100 start = System.Environment.TickCount blah = 0 randgen = System.Random() highnum = 0.0 for i in range(kTotalReps): myt = [] for j in range(kNumReps): toadd = randgen.NextDouble() myt.append(toadd) highnum = max(highnum, toadd) blah = blah + 1 print blah print highnum print (System.Environment.TickCount-start) ---------------------- CPy version: ---------------------- import time import random kTotalReps = 800 kNumReps = 100 start = time.time() blah = 0 highnum = 0.0 for i in range(kTotalReps): myt = [] for j in range(kNumReps): toadd = random.random() myt.append(toadd) highnum = max(highnum, toadd) blah = blah + 1 print blah print highnum print (time.time()-start)*1000 ----------------------- From jimhug at exchange.microsoft.com Thu Oct 13 03:14:57 2005 From: jimhug at exchange.microsoft.com (Jim Hugunin) Date: Wed, 12 Oct 2005 18:14:57 -0700 Subject: [IronPython] CPython 25x faster than IronPython on this code In-Reply-To: Message-ID: <1DFB396200705E46B5338CA4B2E25BDE9E7C23@DF-BANDIT-MSG.exchange.corp.microsoft.com> I can make some fairly small changes to this test and find that IronPython is about 1.3x faster than CPython on roughly the same code. The fact that I need to make changes is obviously not a good thing. However, the changes that I made help show the kinds of rough edges we have left before getting to IronPython 1.0. Here are the four issues I found while playing with your program. 1. We're rapidly increasing the number of standard CPython modules that run in IronPython, but we're probably not making it clear enough to folks how to use them. I use the following tiny site.py file so that I can import from the standard CPython Lib: ---- site.py ---- import sys sys.path.append('c://Python24//Lib') ----------------- The random module is working in the IronPython 0.9.2 and later, so if you drop in this site.py, your CPy version will run just fine in IronPython. 2. The first thing you'll notice if you do that is that the numbers look horrible. IronPython appears to be about 8 orders of magnitude slower than CPython. This is a stupid and outrageous bug in time.time which we'll fix where it's reporting 100 nanosecond ticks as seconds. For now, you should use time.clock instead which will work correctly on both systems. 3. The next issue is that the max builtin in IronPython is horribly slow. It's more than 25x slower than the max in CPython. This is the primary cause of your slow-down. We need to fix this. The reason for the slow-down is that max has an overload which accepts a params object[] (the Python equivalent of *args) and we wind up going through an extremely slow method dispatch path to figure out which overload of max to call. This is more work than fixing time.time, but not that much. The work-around for now is to define a fast_max function in Python. 4. After fixing the perf issue with max, I find that IronPython is still about 1.6x slower than CPython running this test. This final performance hit turns out to come from random.random. This is another case of a slow path where IronPython doesn't do so well looking up members on external modules. CPython isn't lightning fast at this either, and you can speed up both implementations by putting random.random into a variable called rand. We'll be fixing this too, but these kinds of slow-downs are obviously of a lower priority than the jaw-dropping 25x one you found for max. After the changes above, IronPython on my box is about 1.3x faster than CPython. #1 and 2 are simple fixes. #3 and 4 will require bigger fixes, but these are the kinds of things we're addressing for IronPython 1.0. Here's my final version of the code with the changes mentioned above, plus a few small changes to make the timing and reporting a little friendlier by running for more iterations and collecting the stop time before printing anything. ----------------------------- import time import random def fast_max(x,y): if x > y: return x else: return y kTotalReps = 8000 kNumReps = 100 start = time.clock() blah = 0 highnum = 0.0 rand = random.random for i in range(kTotalReps): myt = [] for j in range(kNumReps): toadd = rand() myt.append(toadd) highnum = fast_max(highnum, toadd) blah = blah + 1 end = time.clock() print highnum print '%.3f seconds for %d iterations' % (end-start, blah) ------------------------------- Thanks for the entertaining example - Jim -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Chris Trimble Sent: Wednesday, October 12, 2005 9:52 AM To: users at lists.ironpython.com Subject: [IronPython] CPython 25x faster than IronPython on this code This same program in interpreted C# or Java (as opposed to JITed) runs about the same speed as CPython (~110ms on my machine). IronPython takes almost 3 seconds in the inner loops. Any ideas why? IronPy version: ------------------------ import System kTotalReps = 800 kNumReps = 100 start = System.Environment.TickCount blah = 0 randgen = System.Random() highnum = 0.0 for i in range(kTotalReps): myt = [] for j in range(kNumReps): toadd = randgen.NextDouble() myt.append(toadd) highnum = max(highnum, toadd) blah = blah + 1 print blah print highnum print (System.Environment.TickCount-start) ---------------------- CPy version: ---------------------- import time import random kTotalReps = 800 kNumReps = 100 start = time.time() blah = 0 highnum = 0.0 for i in range(kTotalReps): myt = [] for j in range(kNumReps): toadd = random.random() myt.append(toadd) highnum = max(highnum, toadd) blah = blah + 1 print blah print highnum print (time.time()-start)*1000 ----------------------- _______________________________________________ users mailing list users at lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com From rajesh1986 at gmail.com Thu Oct 13 14:46:24 2005 From: rajesh1986 at gmail.com (Rajesh Sathyamoorthy) Date: Thu, 13 Oct 2005 20:46:24 +0800 Subject: [IronPython] Need Help To Start Learning. Message-ID: <47a726d60510130546p7a326827g70b258b02a59991f@mail.gmail.com> Hi, I am familiar with python but not with .NET. I also do not know any other programming language like C# and VB so following tutorials can be difficult. What steps should I take to start learning how to use ironpython? Thank You. -------------- next part -------------- An HTML attachment was scrubbed... URL: From Martin.Maly at microsoft.com Fri Oct 14 05:32:41 2005 From: Martin.Maly at microsoft.com (Martin Maly) Date: Thu, 13 Oct 2005 20:32:41 -0700 Subject: [IronPython] IronPython 0.9.3 released Message-ID: <1DFB396200705E46B5338CA4B2E25BDE9E7F05@DF-BANDIT-MSG.exchange.corp.microsoft.com> Hello IronPython community, today, we have released IronPython 0.9.3. The biggest change for the release is the implementation of closures and re-factoring of the name-tables. The closures were becoming the limitation of IronPython that we were coming across more and more often when working on the regression test suite. Most of the bugs fixed are closure related, but there are few others that we fixed: * Closures and closure related changes: - Name is resolved to object in enclosing scope, even though it is defined in the current scope (later) - Closures are broken - self not known in definition of lambda function - self not known in lambda function * Generator releated bugfixes: - CodeGen for nested generators throws in some cases - Re-generating code with generators throws - codegen for generators modified state of AST which would cause exceptions on 2nd pass * True/False issue - comparison code didn't handle boolean type properly. For example True == False didn't return False * Changes in import statement name binding - rework of import statement. import binds to local names rather than global ones * Old type class doesn't have __dict__ * FastEval option doesn't resolve builtin names Our thans for feedback and bug reports go to: Jacques de Hooge, Jonathan Jacobs, Sumit Basu and Szymon Kobalczyk You can download the new IronPython release at: http://www.microsoft.com/downloads/details.aspx?FamilyID=c6a7fee3-6495-4 27f-8b1f-768a2715170c&displaylang=en Thanks very much and keep in touch The IronPython Team http://workspaces.gotdotnet.com/ironpython http://lists.ironpython.com/listinfo.cgi/users-ironpython.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From info at geatec.com Fri Oct 14 14:52:27 2005 From: info at geatec.com (J. de Hooge) Date: Fri, 14 Oct 2005 14:52:27 +0200 Subject: [IronPython] IronPython 0.9.3 released In-Reply-To: <1DFB396200705E46B5338CA4B2E25BDE9E7F05@DF-BANDIT-MSG.exchange.corp.microsoft.com> Message-ID: <000001c5d0be$224de0e0$6402a8c0@GEADELL> 0.9.3 is a big improvement. The closures really make my code a lot more compact and readable. I am impressed by the speed of progress on IronPython. After a few months of development using the combination of IronPython and WinForms I've grown addicted. Has been a long time since programming was so much fun! Thanks Jacques de Hooge -----Oorspronkelijk bericht----- Van: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] Namens Martin Maly Verzonden: Friday, October 14, 2005 4:33 AM Aan: Discussion of IronPython Onderwerp: [IronPython] IronPython 0.9.3 released Hello IronPython community, today, we have released IronPython 0.9.3. The biggest change for the release is the implementation of closures and re-factoring of the name-tables. The closures were becoming the limitation of IronPython that we were coming across more and more often when working on the regression test suite. Most of the bugs fixed are closure related, but there are few others that we fixed: * Closures and closure related changes: - Name is resolved to object in enclosing scope, even though it is defined in the current scope (later) - Closures are broken - self not known in definition of lambda function - self not known in lambda function * Generator releated bugfixes: - CodeGen for nested generators throws in some cases - Re-generating code with generators throws - codegen for generators modified state of AST which would cause exceptions on 2nd pass * True/False issue - comparison code didn't handle boolean type properly. For example True == False didn't return False * Changes in import statement name binding - rework of import statement. import binds to local names rather than global ones * Old type class doesn't have __dict__ * FastEval option doesn't resolve builtin names Our thans for feedback and bug reports go to: Jacques de Hooge, Jonathan Jacobs, Sumit Basu and Szymon Kobalczyk You can download the new IronPython release at: http://www.microsoft.com/downloads/details.aspx?FamilyID=c6a7fee3-6495-427f- 8b1f-768a2715170c &displaylang=en Thanks very much and keep in touch The IronPython Team http://workspaces.gotdotnet.com/ironpython http://lists.ironpython.com/listinfo.cgi/users-ironpython.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From papanii.okai at gmail.com Sat Oct 15 09:19:23 2005 From: papanii.okai at gmail.com (Papanii Okai) Date: Sat, 15 Oct 2005 00:19:23 -0700 Subject: [IronPython] importing the os module Message-ID: <002201c5d158$c59f5d10$0138fea9@goku> Hi Guys, I was testing out Iron Python and I was trying to test out the OS module but I got the error .. TraceBack (most recent call last) At ImportError: No module named os.. Obviously it doesn't exist. Thus is there any means to get around this? Thank you --Papanii -------------- next part -------------- An HTML attachment was scrubbed... URL: From mailinglist.account at gmail.com Sat Oct 15 13:11:45 2005 From: mailinglist.account at gmail.com (Anthony Tarlano) Date: Sat, 15 Oct 2005 13:11:45 +0200 Subject: [IronPython] importing the os module In-Reply-To: <002201c5d158$c59f5d10$0138fea9@goku> References: <002201c5d158$c59f5d10$0138fea9@goku> Message-ID: Papanii, Double check your setup, since here is what I get importing os: IronPython 0.9.3 on .NET 2.0.50215.44 Copyright (c) Microsoft Corporation. All rights reserved. >>> import os >>> dir(os) ['AttributeError', 'Equals', 'False', 'GetHashCode', 'GetType', 'ImportError', ' MakeNew', 'NameError', 'None', 'ToString', 'True', '_', '__all__', '__builtins__ ', '__dict__', '__doc__', '__file__', '__name__', '_copy_reg', '_execvpe', '_exi sts', '_exit', '_get_exports_list', '_make_stat_result', '_make_statvfs_result', '_pickle_stat_result', '_pickle_statvfs_result', 'altsep', 'curdir', 'defpath', 'dict', 'dir', 'environ', 'error', 'eval', 'execl', 'execle', 'execlp', 'execlp e', 'execvp', 'execvpe', 'extsep', 'getcwd', 'getenv', 'linesep', 'list', 'listd ir', 'makedirs', 'name', 'pardir', 'path', 'pathsep', 'remove', 'removedirs', 'r enames', 'sep', 'spawnl', 'stat', 'stat_result', 'sys', 'unlink', 'waitpid', 'wa lk'] >>> Regards, Anthony On 10/15/05, Papanii Okai wrote: > > Hi Guys, > > I was testing out Iron Python and I was trying to test out the OS module > but I got the error .. > > TraceBack (most recent call last) > > At > > ImportError: No module named os.. > > Obviously it doesn't exist. Thus is there any means to get around this? > > Thank you > > --Papanii > > > _______________________________________________ > users mailing list > users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From Martin.Maly at microsoft.com Sat Oct 15 15:38:55 2005 From: Martin.Maly at microsoft.com (Martin Maly) Date: Sat, 15 Oct 2005 06:38:55 -0700 Subject: [IronPython] importing the os module In-Reply-To: <002201c5d158$c59f5d10$0138fea9@goku> Message-ID: <1DFB396200705E46B5338CA4B2E25BDEA4B0C9@DF-BANDIT-MSG.exchange.corp.microsoft.com> You can either use the CPython libraries, or instead of "os" use the "nt" module which IronPython contains. Martin ________________________________ From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Papanii Okai Sent: Saturday, October 15, 2005 12:19 AM To: users at lists.ironpython.com Subject: [IronPython] importing the os module Hi Guys, I was testing out Iron Python and I was trying to test out the OS module but I got the error .. TraceBack (most recent call last) At ImportError: No module named os.. Obviously it doesn't exist. Thus is there any means to get around this? Thank you --Papanii -------------- next part -------------- An HTML attachment was scrubbed... URL: From papanii.okai at gmail.com Sat Oct 15 21:07:18 2005 From: papanii.okai at gmail.com (Papanii Okai) Date: Sat, 15 Oct 2005 12:07:18 -0700 Subject: [IronPython] importing the os module In-Reply-To: <1DFB396200705E46B5338CA4B2E25BDEA4B0C9@DF-BANDIT-MSG.exchange.corp.microsoft.com> Message-ID: <001001c5d1bb$abe33190$0138fea9@goku> Thanx a lot guys. --Papanii _____ From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Martin Maly Sent: Saturday, October 15, 2005 6:39 AM To: Discussion of IronPython Subject: Re: [IronPython] importing the os module You can either use the CPython libraries, or instead of "os" use the "nt" module which IronPython contains. Martin _____ From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Papanii Okai Sent: Saturday, October 15, 2005 12:19 AM To: users at lists.ironpython.com Subject: [IronPython] importing the os module Hi Guys, I was testing out Iron Python and I was trying to test out the OS module but I got the error .. TraceBack (most recent call last) At ImportError: No module named os.. Obviously it doesn't exist. Thus is there any means to get around this? Thank you --Papanii -------------- next part -------------- An HTML attachment was scrubbed... URL: From papanii.okai at gmail.com Sun Oct 16 01:53:26 2005 From: papanii.okai at gmail.com (Papanii Okai) Date: Sat, 15 Oct 2005 16:53:26 -0700 Subject: [IronPython] importing the os module In-Reply-To: <1DFB396200705E46B5338CA4B2E25BDEA4B0C9@DF-BANDIT-MSG.exchange.corp.microsoft.com> Message-ID: <000001c5d1e3$a3386290$0138fea9@goku> Ok, so I stepped through with the debugger and found out that IO module wasn't begin called. Are io and os built in modules? Below is a copy of the stack trace.. Thread [#:0] *0. IronPython.Objects.Importer.ImportTop (PythonModule.cs:182) 1. IronPython.Objects.Importer.ImportModule (PythonModule.cs:165) 2. IronPython.Modules.Builtin.__import__ (__builtin__.cs:60) 3. ReflectOpt.IronPython.Modules.Builtin.__import__ (source line information unavailable) 4. IronPython.Objects.BuiltinFunction.Call (BuiltinFunction.cs:101) 5. IronPython.Objects.Ops.Call (Ops.cs:1423) 6. IronPython.Objects.Importer.Import (PythonModule.cs:151) 7. IronPython.Objects.Ops.Import (Ops.cs:1864) 8. input_2.Run (source line information unavailable) 9. IronPython.Hosting.PythonEngine.DoOneInteractive (PythonEngine.cs:278) 10. IronPython.Hosting.PythonEngine.RunInteractive (PythonEngine.cs:227) 11. IronPythonConsole.PythonCommandLine.RunInteractive (PythonCommandLine.cs:151) 12. IronPythonConsole.PythonCommandLine.Main (PythonCommandLine.cs:40) --Papanii _____ From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Martin Maly Sent: Saturday, October 15, 2005 6:39 AM To: Discussion of IronPython Subject: Re: [IronPython] importing the os module You can either use the CPython libraries, or instead of "os" use the "nt" module which IronPython contains. Martin _____ From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Papanii Okai Sent: Saturday, October 15, 2005 12:19 AM To: users at lists.ironpython.com Subject: [IronPython] importing the os module Hi Guys, I was testing out Iron Python and I was trying to test out the OS module but I got the error .. TraceBack (most recent call last) At ImportError: No module named os.. Obviously it doesn't exist. Thus is there any means to get around this? Thank you --Papanii -------------- next part -------------- An HTML attachment was scrubbed... URL: From Martin.Maly at microsoft.com Sun Oct 16 02:01:49 2005 From: Martin.Maly at microsoft.com (Martin Maly) Date: Sat, 15 Oct 2005 17:01:49 -0700 Subject: [IronPython] importing the os module In-Reply-To: <000001c5d1e3$a3386290$0138fea9@goku> Message-ID: <1DFB396200705E46B5338CA4B2E25BDEA4B0E0@DF-BANDIT-MSG.exchange.corp.microsoft.com> In standard Python, os is not a built-in module, however, nt module is built-in. IronPython includes built-in nt moduel (as built-in module implemented in c#), but not the os. module. I am not understanding your question about the IO module. There is no "io" module in neither CPython nor IronPython: Python 2.4.2 (#67, Sep 28 2005, 12:41:11) [MSC v.1310 32 bit (Intel)] on win32 Type "help", "copyright", "credits" or "license" for more information. >>> import io Traceback (most recent call last): File "", line 1, in ? ImportError: No module named io Martin ________________________________ From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Papanii Okai Sent: Saturday, October 15, 2005 4:53 PM To: 'Discussion of IronPython' Subject: Re: [IronPython] importing the os module Ok, so I stepped through with the debugger and found out that IO module wasn't begin called. Are io and os built in modules? Below is a copy of the stack trace.. Thread [#:0] *0. IronPython.Objects.Importer.ImportTop (PythonModule.cs:182) 1. IronPython.Objects.Importer.ImportModule (PythonModule.cs:165) 2. IronPython.Modules.Builtin.__import__ (__builtin__.cs:60) 3. ReflectOpt.IronPython.Modules.Builtin.__import__ (source line information unavailable) 4. IronPython.Objects.BuiltinFunction.Call (BuiltinFunction.cs:101) 5. IronPython.Objects.Ops.Call (Ops.cs:1423) 6. IronPython.Objects.Importer.Import (PythonModule.cs:151) 7. IronPython.Objects.Ops.Import (Ops.cs:1864) 8. input_2.Run (source line information unavailable) 9. IronPython.Hosting.PythonEngine.DoOneInteractive (PythonEngine.cs:278) 10. IronPython.Hosting.PythonEngine.RunInteractive (PythonEngine.cs:227) 11. IronPythonConsole.PythonCommandLine.RunInteractive (PythonCommandLine.cs:151) 12. IronPythonConsole.PythonCommandLine.Main (PythonCommandLine.cs:40) --Papanii ________________________________ From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Martin Maly Sent: Saturday, October 15, 2005 6:39 AM To: Discussion of IronPython Subject: Re: [IronPython] importing the os module You can either use the CPython libraries, or instead of "os" use the "nt" module which IronPython contains. Martin ________________________________ From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Papanii Okai Sent: Saturday, October 15, 2005 12:19 AM To: users at lists.ironpython.com Subject: [IronPython] importing the os module Hi Guys, I was testing out Iron Python and I was trying to test out the OS module but I got the error .. TraceBack (most recent call last) At ImportError: No module named os.. Obviously it doesn't exist. Thus is there any means to get around this? Thank you --Papanii -------------- next part -------------- An HTML attachment was scrubbed... URL: From papanii.okai at gmail.com Mon Oct 17 00:06:30 2005 From: papanii.okai at gmail.com (Papanii Okai) Date: Sun, 16 Oct 2005 15:06:30 -0700 Subject: [IronPython] importing the os module In-Reply-To: <1DFB396200705E46B5338CA4B2E25BDEA4B0E0@DF-BANDIT-MSG.exchange.corp.microsoft.com> Message-ID: <002d01c5d29d$dd95d610$0138fea9@goku> Hmm, I tend to disagree with you on the fact that in standard python os is not a built in module. Even though nt is built in, the os modules also built in. But what is confusing is that Anthony posted that he was able to import the os module like so. Anthony's post.. Double check your setup, since here is what I get importing os: IronPython 0.9.3 on .NET 2.0.50215.44 Copyright (c) Microsoft Corporation. All rights reserved. >>> import os >>> dir(os) ['AttributeError', 'Equals', 'False', 'GetHashCode', 'GetType', 'ImportError', ' MakeNew', 'NameError', 'None', 'ToString', 'True', '_', '__all__', '__builtins__ ', '__dict__', '__doc__', '__file__', '__name__', '_copy_reg', '_execvpe', '_exi sts', '_exit', '_get_exports_list', '_make_stat_result', '_make_statvfs_result', '_pickle_stat_result', '_pickle_statvfs_result', 'altsep', 'curdir', 'defpath', 'dict', 'dir', 'environ', 'error', 'eval', 'execl', 'execle', 'execlp', 'execlp e', 'execvp', 'execvpe', 'extsep', 'getcwd', 'getenv', 'linesep', 'list', 'listd ir', 'makedirs', 'name', 'pardir', 'path', 'pathsep', 'remove', 'removedirs', 'r enames', 'sep', 'spawnl', 'stat', 'stat_result', 'sys', 'unlink', 'waitpid', 'wa lk'] >>> He said it had something to do with my set up. Anyway, in terms of the os module in standard python I could do something like so. Import os doesFileExist = os.path.isdir(FileName) if(doesFileExist): print FileName else: print 'No file' In terms of using the nt module, how would I implement this? _____ From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Martin Maly Sent: Saturday, October 15, 2005 5:02 PM To: Discussion of IronPython Subject: Re: [IronPython] importing the os module In standard Python, os is not a built-in module, however, nt module is built-in. IronPython includes built-in nt moduel (as built-in module implemented in c#), but not the os. module. I am not understanding your question about the IO module. There is no "io" module in neither CPython nor IronPython: Python 2.4.2 (#67, Sep 28 2005, 12:41:11) [MSC v.1310 32 bit (Intel)] on win32 Type "help", "copyright", "credits" or "license" for more information. >>> import io Traceback (most recent call last): File "", line 1, in ? ImportError: No module named io Martin _____ From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Papanii Okai Sent: Saturday, October 15, 2005 4:53 PM To: 'Discussion of IronPython' Subject: Re: [IronPython] importing the os module Ok, so I stepped through with the debugger and found out that IO module wasn't begin called. Are io and os built in modules? Below is a copy of the stack trace.. Thread [#:0] *0. IronPython.Objects.Importer.ImportTop (PythonModule.cs:182) 1. IronPython.Objects.Importer.ImportModule (PythonModule.cs:165) 2. IronPython.Modules.Builtin.__import__ (__builtin__.cs:60) 3. ReflectOpt.IronPython.Modules.Builtin.__import__ (source line information unavailable) 4. IronPython.Objects.BuiltinFunction.Call (BuiltinFunction.cs:101) 5. IronPython.Objects.Ops.Call (Ops.cs:1423) 6. IronPython.Objects.Importer.Import (PythonModule.cs:151) 7. IronPython.Objects.Ops.Import (Ops.cs:1864) 8. input_2.Run (source line information unavailable) 9. IronPython.Hosting.PythonEngine.DoOneInteractive (PythonEngine.cs:278) 10. IronPython.Hosting.PythonEngine.RunInteractive (PythonEngine.cs:227) 11. IronPythonConsole.PythonCommandLine.RunInteractive (PythonCommandLine.cs:151) 12. IronPythonConsole.PythonCommandLine.Main (PythonCommandLine.cs:40) --Papanii _____ From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Martin Maly Sent: Saturday, October 15, 2005 6:39 AM To: Discussion of IronPython Subject: Re: [IronPython] importing the os module You can either use the CPython libraries, or instead of "os" use the "nt" module which IronPython contains. Martin _____ From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Papanii Okai Sent: Saturday, October 15, 2005 12:19 AM To: users at lists.ironpython.com Subject: [IronPython] importing the os module Hi Guys, I was testing out Iron Python and I was trying to test out the OS module but I got the error .. TraceBack (most recent call last) At ImportError: No module named os.. Obviously it doesn't exist. Thus is there any means to get around this? Thank you --Papanii -------------- next part -------------- An HTML attachment was scrubbed... URL: From drew at astro.pas.rochester.edu Mon Oct 17 01:14:29 2005 From: drew at astro.pas.rochester.edu (Drew Moore) Date: Sun, 16 Oct 2005 19:14:29 -0400 Subject: [IronPython] importing the os module In-Reply-To: <002d01c5d29d$dd95d610$0138fea9@goku> References: <002d01c5d29d$dd95d610$0138fea9@goku> Message-ID: <4352DED5.90802@astro.pas.rochester.edu> An HTML attachment was scrubbed... URL: From papanii.okai at gmail.com Mon Oct 17 03:03:12 2005 From: papanii.okai at gmail.com (Papanii Okai) Date: Sun, 16 Oct 2005 18:03:12 -0700 Subject: [IronPython] importing the os module In-Reply-To: <4352DED5.90802@astro.pas.rochester.edu> Message-ID: <003901c5d2b6$8c6c3630$0138fea9@goku> Thanks a lot Drew... --Papanii _____ From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Drew Moore Sent: Sunday, October 16, 2005 4:14 PM To: Discussion of IronPython Subject: Re: [IronPython] importing the os module Papanii Okai wrote: Hmm, I tend to disagree with you on the fact that in standard python os is not a built in module. Even though nt is built in, the os modules also built in. But what is confusing is that Anthony posted that he was able to import the os module like so. Define 'builtin'. (define 'sex' ;-) >From cpython's help utility.. Help on built-in module sys: NAME sys FILE (built-in) Help on module os: NAME os - OS routines for Mac, DOS, NT, or Posix depending on what system we're on. FILE /usr/lib/python2.3/os.py os.py == not builtin I often describe the "help" utility as "built in." really, it is not.. it is a standard part of python.. but it is written as a python module, not a core part of the interpreter written in pure C. The help facility, which I use all the time in cpython, and semantically consider a builtin, is *not* technically a builtin. It comes from pydoc.py. Which rocks. But is not built in. cheers Drew -------------- next part -------------- An HTML attachment was scrubbed... URL: From hyp3rspace at hotmail.com Mon Oct 17 06:28:06 2005 From: hyp3rspace at hotmail.com (Nathan Gray) Date: Sun, 16 Oct 2005 21:28:06 -0700 Subject: [IronPython] unsubscribe In-Reply-To: <003901c5d2b6$8c6c3630$0138fea9@goku> Message-ID: Hi - I'm sorry, but can you point me to the procedures for unregistering for this mail list? Thanks, Nathan From alleykat at gmail.com Mon Oct 17 06:32:03 2005 From: alleykat at gmail.com (Travis Watkins) Date: Sun, 16 Oct 2005 23:32:03 -0500 Subject: [IronPython] unsubscribe In-Reply-To: References: <003901c5d2b6$8c6c3630$0138fea9@goku> Message-ID: On 10/16/05, Nathan Gray wrote: > Hi - I'm sorry, but can you point me to the procedures for unregistering for > this mail list? > > Thanks, > Nathan > > > _______________________________________________ > users mailing list > users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com ^^^ Go there. -- Travis Watkins http://www.realistanew.com From papanii.okai at gmail.com Mon Oct 17 06:38:31 2005 From: papanii.okai at gmail.com (Papanii Okai) Date: Sun, 16 Oct 2005 21:38:31 -0700 Subject: [IronPython] unsubscribe In-Reply-To: Message-ID: <004c01c5d2d4$a0e55150$0138fea9@goku> Sure.. Just go to the link below and enter your email in the unsubscribe area. -> http://lists.ironpython.com/listinfo.cgi/users-ironpython.com --Papanii -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Nathan Gray Sent: Sunday, October 16, 2005 9:28 PM To: users at lists.ironpython.com Subject: Re: [IronPython] unsubscribe Hi - I'm sorry, but can you point me to the procedures for unregistering for this mail list? Thanks, Nathan _______________________________________________ users mailing list users at lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com From korpse-ironpython at kaydash.za.net Mon Oct 17 09:25:24 2005 From: korpse-ironpython at kaydash.za.net (Jonathan Jacobs) Date: Mon, 17 Oct 2005 09:25:24 +0200 Subject: [IronPython] importing the os module In-Reply-To: <002d01c5d29d$dd95d610$0138fea9@goku> References: <002d01c5d29d$dd95d610$0138fea9@goku> Message-ID: <435351E4.4010409@kaydash.za.net> Papanii Okai wrote: > Hmm, I tend to disagree with you on the fact that in standard python os > is not a built in module. Even though nt is built in, the os modules > also built in. But what is confusing is that Anthony posted that he was > able to import the os module like so? Anthony is probably making use of site.py (which can be found in \bin\Lib) to make the Python stdlib accessible to IronPython. (That is, unless I'm mistaken.) Jim mentions[1] a short site.py in one of his recent emails which is probably just what you're looking for. Hope this helps. [1] http://lists.ironpython.com/pipermail/users-ironpython.com/2005-October/001092.html -- Jonathan When you meet a master swordsman, show him your sword. When you meet a man who is not a poet, do not show him your poem. -- Rinzai, ninth century Zen master From papanii.okai at gmail.com Mon Oct 17 10:04:04 2005 From: papanii.okai at gmail.com (Papanii Okai) Date: Mon, 17 Oct 2005 01:04:04 -0700 Subject: [IronPython] importing the os module In-Reply-To: <435351E4.4010409@kaydash.za.net> Message-ID: <000301c5d2f1$5821f960$0138fea9@goku> Thanx Jonathan the link you provided proved very useful.. --Papanii -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Jonathan Jacobs Sent: Monday, October 17, 2005 12:25 AM To: Discussion of IronPython Subject: Re: [IronPython] importing the os module Papanii Okai wrote: > Hmm, I tend to disagree with you on the fact that in standard python os > is not a built in module. Even though nt is built in, the os modules > also built in. But what is confusing is that Anthony posted that he was > able to import the os module like so. Anthony is probably making use of site.py (which can be found in \bin\Lib) to make the Python stdlib accessible to IronPython. (That is, unless I'm mistaken.) Jim mentions[1] a short site.py in one of his recent emails which is probably just what you're looking for. Hope this helps. [1] http://lists.ironpython.com/pipermail/users-ironpython.com/2005-October/0010 92.html -- Jonathan When you meet a master swordsman, show him your sword. When you meet a man who is not a poet, do not show him your poem. -- Rinzai, ninth century Zen master _______________________________________________ users mailing list users at lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com From dr.addn at gmail.com Mon Oct 17 15:17:00 2005 From: dr.addn at gmail.com (adDoc's networker Phil) Date: Mon, 17 Oct 2005 06:17:00 -0700 Subject: [IronPython] Need Help To Start Learning. In-Reply-To: <47a726d60510130546p7a326827g70b258b02a59991f@mail.gmail.com> References: <47a726d60510130546p7a326827g70b258b02a59991f@mail.gmail.com> Message-ID: <8fd4a2fe0510170617v3eca1136n2e3f3166cb1a8ce4@mail.gmail.com> . the quick answer for getting started with ironpython is to get started with zope`s python for .NET [@] http://www.zope.org/Members/Brian/PythonNet/readme.html#getting_started . ironpython is at microsoft and it is alpha; so, there may not be a lot of help besides knowing that iron python is just python for another platform (lots of help for python) . an easier approach might come from zope; [@] http://www.zope.org/Members/Brian/PythonNet but, this appears to have a problem with python`s exceptions being old-style classes, instead of new-style classes that don't have to subclass Python's Exception class, although Py'NET`s author is under the impression that the next version of Python might change for .NET compatability . I'm personally putting my bets on pypy [@] http://codespeak.net/pypy/dist/pypy/doc/index.html . not only is pypy getting european funding for being fork-friendly (it`s written in python), it also has a back end for llvm [@] http://lambda-the-ultimate.org/node/view/141#comment-986 (it compiles python to LLVM (Low-Level Virtual Machine code)) . LLVM is [/]hot: [@] http://llvm.cs.uiuc.edu/ every language should have a port to LLVM; and every platform should have an LLVM -to- native|managed code compiler Python for .NET 1.0 beta 5 is based on Python 2.4 [@] http://www.zope.org/Members/Brian/PythonNet/Releases/PythonNet-1.0-beta5.tgz "(. zope`s package does *not* produce managed code (IL) from Python code . Rather, it is an integration of the C Python engine with the .NET runtime . This approach allows you to use the CLR services and continue to use existing Python C extensions while maintaining native execution speeds for Python code. ) *Why Python For .NET?* Python for .NET gives Python programmers near-seamless integration with the .NET Common Language Runtime (CLR) and provides a powerful tool for application scripting for .NET developers . Using this package you can script CLR applications or build entire applications in Python, using CLR services and components written in any language that targets the CLR (Managed C++, C#, VB, JScript, etc.). Is This Like Jython for .NET? Not really. Jython provides an implementation of the Python language and runtime engine in pure Java. Python for .NET is not a re-implementation of Python, just an integration of the existing CPython runtime with .NET. While a solution like Jython provides "two-way" interoperability, this package only provides "one-way" integration. Meaning, while Python can use types and services implemented in .NET, managed code cannot generally use classes implemented in Python. A Jython-like solution for .NET would certainly be doable and useful - but it would also require far more work than the current approach. Is This Related To ActiveState's Python.NET Work? No. That effort focused on the feasibility of making Python a true .NET language (compiling Python to IL). You can find that work as well as a paper describing the goals and results at http://www.activestate.com. [*][. this is from the [/]download`s readme:] open source Zope Public License (ZPL). : http://www.zope.org/Products/Zope/LICENSE_20.txt. **Does it work with Mono?** Preliminary testing shows that PythonNet will run under mono, though the test suite fails quickly due to NotImplemented errors raised in parts of the Mono runtime. The PythonNet integration layer is 100% managed code, so there are no long-term issues under mono - it should work better and better as the mono platform matures. It is not currently possible to *build* PythonNet using only the Mono tools, due to an issue involving the Mono assembler / disassembler. You should, however, be able to try the pre-built assembly under Mono (or compile it yourself with the MS tools and run it under Mono). Note that if you are running under Mono on a *nix system, you will need to have Python 2.4 installed. You will probably also have to make a symlink in the PythonNet directory pointing to the libpython2.4.soon your system. You will need to name the symlink 'python24.so'. **What is the current status of the package?** The Python for .NET runtime is quite stable and is nearly feature complete. There are a large number of unit tests as well as a number of stress tests, leak tests and demo scripts. There are still some loose ends to finish up for the 1.0 release, but it is definitely usable for real applications. Current issues: - Managed exceptions are not integrated well with Python exceptions, due to Python's insistence that exceptions must be old-style classes. Not sure if there is a sneaky way around it, other than lobbying Guido to look at it for a future Python version. Currently, it looks like Python 2.5 will support new-style classes as exceptions. - Packaging is still pretty minimal. There should probably be an msi installer etc. for win32. [*]distr`doc/todo: ToDo List: - incorporate fxcop suggestions - out, ref params - - Fix anything that relies on member order in reflection - this will change post 1.1 - Support out and in/out params - fix loss of python wrapped instances when handed over to clr - Finish leaktest.py and finish checking for leaks. - Implement class wrappers to allow Python code to implement interfaces and abstract .NET classes - Finish basic embedding APIs & tests - Integrate nunit 2 - Test thread state management & async delegates - Tests for overload selection - Cached type in TypeManager need to be cleaned up on managed runtime finalization (low priority); review finalization generally. - Pester Guido about letting exceptions be new-style classes that don't have to subclass Python's Exception class :) See if there is some sneaky way around it. - Look at optimizing some type conversions FAQ items: - document loading specific versions of assemblies llvm tip (Execution Engine-independent JIT compilers) [@] http://blogs.msdn.com/michaljc/ I have recently put together a set of slides about LIL (Low-level Intermediate Language) and gave a talk at Microsoft. This work was done before I joined Microsoft: LIL was developed by the ORP (Open Runtime Platform) team at Intel. LIL was addressing multiple issues in the ORP design (papers referenced below can give you an idea) but the focus of this presentation was more narrow: how to improve the interface between the JIT (Just-In-Time compiler) and the rest of the VM. I'd like to point out that I use the terms VM (Virtual Machine) and EE (Execution Engine) interchangeably (see this post for a discussion of this terminology). Others have come up independently with somewhat similar ideas and I found quite a lot of interest in the LIL approach in conversations both inside and outside of Microsoft. For my current presentation I took some of the old LIL slides that I used in a talk I gave at ETH Z?rich in 2003 and modified them to focus on the JIT/EE interface. This version of slides benefited from my conversations with many people in the last year, after the original LIL papers were published. I think that I owe most to my conversations with George Bosworth and to comments by Thorsten Brunklauswho worked on the SEAM VM (see below) and now is in the CLR team. LIL is described at length in the VM'04 paper. The MPOOL'03 paper (pdf) presents some thoughts on how LIL could be used to abstract away the object model from the JIT. Full references to these two papers are available on my publications page . The talk I just gave had the title "*Execution Engine-independent JIT compilers*" and the basic idea is that LIL enables a much better abstraction of the EE from a JIT's point of view then what is used in all known to me implementations of virtual machines for JVM and CLR/CLI. I made the full presentation available as a pdf file . Here are references to the related work mentioned in the slides: - Bartok is a compiler developed by the Advanced Compiler Technologygroup at MSR - JikesRVM: http://www.ibm.com/developerworks/oss/jikesrvm - LLVM: http://llvm.cs.uiuc.edu - C--: http://www.cminusminus.org - SEAM: http://www.ps.uni-sb.de/seam (also, this discussionis an entertaining read if you want to see varied opinions on the subject) - PCR: http://portal.acm.org/citation.cfm?id=74862 - Alan Kay's quote is from the ACM Queue article . posted Wednesday, February 23, 2005 4:55 PMby michaljc with 3 Comments On 10/13/05, Rajesh Sathyamoorthy wrote: > > Hi, > > I am familiar with python but not with .NET. I also do not know any other > programming language like C# and VB so following tutorials can be difficult. > What steps should I take to start learning how to use ironpython? > > Thank You. > > _______________________________________________ > users mailing list > users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > > > > -- American Dream Documents http://www.geocities.com/amerdreamdocs/home/ "(real opportunity starts with real documentation) -------------- next part -------------- An HTML attachment was scrubbed... URL: From mailinglist.account at gmail.com Mon Oct 17 22:01:05 2005 From: mailinglist.account at gmail.com (Anthony Tarlano) Date: Mon, 17 Oct 2005 22:01:05 +0200 Subject: [IronPython] importing the os module In-Reply-To: <002d01c5d29d$dd95d610$0138fea9@goku> References: <1DFB396200705E46B5338CA4B2E25BDEA4B0E0@DF-BANDIT-MSG.exchange.corp.microsoft.com> <002d01c5d29d$dd95d610$0138fea9@goku> Message-ID: Papanii, The os module i am importing is coming from cpython modules that I have put in my path. That is the setup that I was talking about. IronPython 0.9.3 on .NET 2.0.50215.44 Copyright (c) Microsoft Corporation. All rights reserved. >>> import os >>> os.__file__ 'C:\\IPython\\bin\\Lib\\os.py' >>> On 10/17/05, Papanii Okai wrote: > > Hmm, I tend to disagree with you on the fact that in standard python os > is not a built in module. Even though nt is built in, the os modules also > built in. But what is confusing is that Anthony posted that he was able to > import the os module like so? > > *Anthony's post?.* > > Double check your setup, since here is what I get importing os: > > IronPython 0.9.3 on .NET 2.0.50215.44 > Copyright (c) Microsoft Corporation. All rights reserved. > >>> import os > >>> dir(os) > ['AttributeError', 'Equals', 'False', 'GetHashCode', 'GetType', > 'ImportError', ' > MakeNew', 'NameError', 'None', 'ToString', 'True', '_', '__all__', > '__builtins__ > ', '__dict__', '__doc__', '__file__', '__name__', '_copy_reg', '_execvpe', > '_exi > sts', '_exit', '_get_exports_list', '_make_stat_result', > '_make_statvfs_result', > '_pickle_stat_result', '_pickle_statvfs_result', 'altsep', 'curdir', > 'defpath', > 'dict', 'dir', 'environ', 'error', 'eval', 'execl', 'execle', 'execlp', > 'execlp > e', 'execvp', 'execvpe', 'extsep', 'getcwd', 'getenv', 'linesep', 'list', > 'listd > ir', 'makedirs', 'name', 'pardir', 'path', 'pathsep', 'remove', > 'removedirs', 'r > enames', 'sep', 'spawnl', 'stat', 'stat_result', 'sys', 'unlink', > 'waitpid', 'wa > lk'] > >>> > > He said it had something to do with my set up. Anyway, in terms of the os > module in standard python I could do something like so. > > * * > > *Import os* > > * * > > *doesFileExist = os.path.isdir(FileName)* > > *if(doesFileExist):* > > * print FileName* > > *else:* > > * print 'No file'* > > In terms of using the nt module, how would I implement this? > > ------------------------------ > > *From:* users-bounces at lists.ironpython.com [mailto: > users-bounces at lists.ironpython.com] *On Behalf Of *Martin Maly > *Sent:* Saturday, October 15, 2005 5:02 PM > *To:* Discussion of IronPython > *Subject:* Re: [IronPython] importing the os module > > In standard Python, os is not a built-in module, however, nt module is > built-in. IronPython includes built-in nt moduel (as built-in module > implemented in c#), but not the os. module. > > I am not understanding your question about the IO module. There is no > "io" module in neither CPython nor IronPython: > > Python 2.4.2 (#67, Sep 28 2005, 12:41:11) [MSC v.1310 32 bit (Intel)] on > win32 > Type "help", "copyright", "credits" or "license" for more information. > >>> import io > Traceback (most recent call last): > File "", line 1, in ? > ImportError: No module named io > > Martin > > ------------------------------ > > *From:* users-bounces at lists.ironpython.com [mailto: > users-bounces at lists.ironpython.com] *On Behalf Of *Papanii Okai > *Sent:* Saturday, October 15, 2005 4:53 PM > *To:* 'Discussion of IronPython' > *Subject:* Re: [IronPython] importing the os module > > Ok, so I stepped through with the debugger and found out that IO module > wasn't begin called. Are io and os built in modules? Below is a copy of the > stack trace.. > > Thread [#:0] > > *0. IronPython.Objects.Importer.ImportTop (PythonModule.cs:182) > > 1. IronPython.Objects.Importer.ImportModule (PythonModule.cs:165) > > 2. IronPython.Modules.Builtin.__import__ (__builtin__.cs:60) > > 3. ReflectOpt.IronPython.Modules.Builtin.__import__ (source line > information unavailable) > > 4. IronPython.Objects.BuiltinFunction.Call (BuiltinFunction.cs:101) > > 5. IronPython.Objects.Ops.Call (Ops.cs:1423) > > 6. IronPython.Objects.Importer.Import (PythonModule.cs:151) > > 7. IronPython.Objects.Ops.Import (Ops.cs:1864) > > 8. input_2.Run (source line information unavailable) > > 9. IronPython.Hosting.PythonEngine.DoOneInteractive (PythonEngine.cs:278) > > 10. IronPython.Hosting.PythonEngine.RunInteractive (PythonEngine.cs:227) > > 11. IronPythonConsole.PythonCommandLine.RunInteractive ( > PythonCommandLine.cs:151) > > 12. IronPythonConsole.PythonCommandLine.Main (PythonCommandLine.cs:40) > > --Papanii > ------------------------------ > > *From:* users-bounces at lists.ironpython.com [mailto: > users-bounces at lists.ironpython.com] *On Behalf Of *Martin Maly > *Sent:* Saturday, October 15, 2005 6:39 AM > *To:* Discussion of IronPython > *Subject:* Re: [IronPython] importing the os module > > You can either use the CPython libraries, or instead of "os" use the "nt" > module which IronPython contains. > > Martin > > ------------------------------ > > *From:* users-bounces at lists.ironpython.com [mailto: > users-bounces at lists.ironpython.com] *On Behalf Of *Papanii Okai > *Sent:* Saturday, October 15, 2005 12:19 AM > *To:* users at lists.ironpython.com > *Subject:* [IronPython] importing the os module > > Hi Guys, > > I was testing out Iron Python and I was trying to test out the OS module > but I got the error .. > > TraceBack (most recent call last) > > At > > ImportError: No module named os.. > > Obviously it doesn't exist. Thus is there any means to get around this? > > Thank you > > --Papanii > > > _______________________________________________ > users mailing list > users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From papanii.okai at gmail.com Mon Oct 17 23:01:58 2005 From: papanii.okai at gmail.com (Papanii Okai) Date: Mon, 17 Oct 2005 14:01:58 -0700 Subject: [IronPython] importing the os module In-Reply-To: Message-ID: <003901c5d35e$04342540$0138fea9@goku> Yes thank you. After reading Jims post on IronPython's efficiency issues, I finally understood what you were talking about. Thanx.. --Papanii _____ From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Anthony Tarlano Sent: Monday, October 17, 2005 1:01 PM To: Discussion of IronPython Subject: Re: [IronPython] importing the os module Papanii, The os module i am importing is coming from cpython modules that I have put in my path. That is the setup that I was talking about. IronPython 0.9.3 on .NET 2.0.50215.44 Copyright (c) Microsoft Corporation. All rights reserved. >>> import os >>> os.__file__ 'C:\\IPython\\bin\\Lib\\os.py' >>> On 10/17/05, Papanii Okai wrote: Hmm, I tend to disagree with you on the fact that in standard python os is not a built in module. Even though nt is built in, the os modules also built in. But what is confusing is that Anthony posted that he was able to import the os module like so. Anthony's post.. Double check your setup, since here is what I get importing os: IronPython 0.9.3 on .NET 2.0.50215.44 Copyright (c) Microsoft Corporation. All rights reserved. >>> import os >>> dir(os) ['AttributeError', 'Equals', 'False', 'GetHashCode', 'GetType', 'ImportError', ' MakeNew', 'NameError', 'None', 'ToString', 'True', '_', '__all__', '__builtins__ ', '__dict__', '__doc__', '__file__', '__name__', '_copy_reg', '_execvpe', '_exi sts', '_exit', '_get_exports_list', '_make_stat_result', '_make_statvfs_result', '_pickle_stat_result', '_pickle_statvfs_result', 'altsep', 'curdir', 'defpath', 'dict', 'dir', 'environ', 'error', 'eval', 'execl', 'execle', 'execlp', 'execlp e', 'execvp', 'execvpe', 'extsep', 'getcwd', 'getenv', 'linesep', 'list', 'listd ir', 'makedirs', 'name', 'pardir', 'path', 'pathsep', 'remove', 'removedirs', 'r enames', 'sep', 'spawnl', 'stat', 'stat_result', 'sys', 'unlink', 'waitpid', 'wa lk'] >>> He said it had something to do with my set up. Anyway, in terms of the os module in standard python I could do something like so. Import os doesFileExist = os.path.isdir(FileName) if(doesFileExist): print FileName else: print 'No file' In terms of using the nt module, how would I implement this? _____ From: users-bounces at lists.ironpython.com [mailto: users-bounces at lists.ironpython.com] On Behalf Of Martin Maly Sent: Saturday, October 15, 2005 5:02 PM To: Discussion of IronPython Subject: Re: [IronPython] importing the os module In standard Python, os is not a built-in module, however, nt module is built-in. IronPython includes built-in nt moduel (as built-in module implemented in c#), but not the os. module. I am not understanding your question about the IO module. There is no "io" module in neither CPython nor IronPython: Python 2.4.2 (#67, Sep 28 2005, 12:41:11) [MSC v.1310 32 bit (Intel)] on win32 Type "help", "copyright", "credits" or "license" for more information. >>> import io Traceback (most recent call last): File "", line 1, in ? ImportError: No module named io Martin _____ From: users-bounces at lists.ironpython.com [mailto: users-bounces at lists.ironpython.com] On Behalf Of Papanii Okai Sent: Saturday, October 15, 2005 4:53 PM To: 'Discussion of IronPython' Subject: Re: [IronPython] importing the os module Ok, so I stepped through with the debugger and found out that IO module wasn't begin called. Are io and os built in modules? Below is a copy of the stack trace.. Thread [#:0] *0. IronPython.Objects.Importer.ImportTop (PythonModule.cs:182) 1. IronPython.Objects.Importer.ImportModule (PythonModule.cs:165) 2. IronPython.Modules.Builtin.__import__ (__builtin__.cs:60) 3. ReflectOpt.IronPython.Modules.Builtin.__import__ (source line information unavailable) 4. IronPython.Objects.BuiltinFunction.Call (BuiltinFunction.cs:101) 5. IronPython.Objects.Ops.Call (Ops.cs:1423) 6. IronPython.Objects.Importer.Import (PythonModule.cs:151) 7. IronPython.Objects.Ops.Import (Ops.cs:1864) 8. input_2.Run (source line information unavailable) 9. IronPython.Hosting.PythonEngine.DoOneInteractive (PythonEngine.cs:278) 10. IronPython.Hosting.PythonEngine.RunInteractive (PythonEngine.cs:227) 11. IronPythonConsole.PythonCommandLine.RunInteractive (PythonCommandLine.cs:151) 12. IronPythonConsole.PythonCommandLine.Main (PythonCommandLine.cs:40) --Papanii _____ From: users-bounces at lists.ironpython.com [mailto: users-bounces at lists.ironpython.com] On Behalf Of Martin Maly Sent: Saturday, October 15, 2005 6:39 AM To: Discussion of IronPython Subject: Re: [IronPython] importing the os module You can either use the CPython libraries, or instead of "os" use the "nt" module which IronPython contains. Martin _____ From: users-bounces at lists.ironpython.com [mailto: users-bounces at lists.ironpython.com] On Behalf Of Papanii Okai Sent: Saturday, October 15, 2005 12:19 AM To: users at lists.ironpython.com Subject: [IronPython] importing the os module Hi Guys, I was testing out Iron Python and I was trying to test out the OS module but I got the error .. TraceBack (most recent call last) At ImportError: No module named os.. Obviously it doesn't exist. Thus is there any means to get around this? Thank you --Papanii _______________________________________________ users mailing list users at lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From arkman3112 at gmail.com Tue Oct 18 20:38:19 2005 From: arkman3112 at gmail.com (Greg Kerr) Date: Tue, 18 Oct 2005 13:38:19 -0500 Subject: [IronPython] IronPython and WPF .. too cool Message-ID: Don't know if anyone wants to see it, or if everyone's way past it, but here is a simple WPF app in IronPython: import sys sys.LoadAssemblyByName( "WindowsBase") sys.LoadAssemblyByName( "PresentationCore") sys.LoadAssemblyByName( "PresentationFramework") sys.LoadAssemblyByName( "UIAutomationProvider") sys.LoadAssemblyByName( "UIAutomationTypes") from System import * from System.Windows import * from System.Windows.Controls import * from System.Windows.Media import * from System.Windows.Media.Animation import * class MyApp (Application): def __init__( self): pass def OnStartup( self, evt): mainWindow = Window(); rootPanel = StackPanel(); rootPanel.Background = SolidColorBrush( Colors.Green); txtElement = TextBlock() txtElement.Margin = Thickness( 10) txtElement.Text = "A TextBlock" txtElement.FontSize = 24 txtElement.Foreground = SolidColorBrush( Colors.White) mainWindow.Content = rootPanel mainWindow.Title = "WPF Window from IronPython" rootPanel.Children.Add( txtElement) opacityAnim = DoubleAnimation( 0.0, Duration(TimeSpan.FromMilliseconds(1000))) opacityAnim.AutoReverse = True opacityAnim.RepeatBehavior = RepeatBehavior.Forever txtElement.BeginAnimation(Control.OpacityProperty, opacityAnim) mainWindow.Show() app = MyApp() app.Run() From gurkan.yeniceri at gmail.com Wed Oct 19 11:00:26 2005 From: gurkan.yeniceri at gmail.com (Gurkan Yeniceri) Date: Wed, 19 Oct 2005 19:00:26 +1000 Subject: [IronPython] new addition Message-ID: Hi People, I have just joined to the list. I have downloaded the Iron Python but don't know where to start. Is there a beginner's web site somewhere? Gurkan Yeniceri Analyst Developer www.analystdeveloper.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From alang.yl at gmail.com Wed Oct 19 13:22:31 2005 From: alang.yl at gmail.com (Crest) Date: Wed, 19 Oct 2005 19:22:31 +0800 Subject: [IronPython] users Digest, Vol 15, Issue 16 In-Reply-To: References: Message-ID: <7fed9b030510190422idc5e11dg28ca9adf21ccaf@mail.gmail.com> Sorry. ----------------------------------------------------------------------------- G:\Pythons\IronPy>ipc wpf.py Traceback (most recent call last): at __main__.Initialize() in G:\Pythons\IronPy\wpf.py:line 2 RuntimeError: Could not load assembly WindowsBase ------------------------------------------------------------------------------ ipc => IronPythonConsole -------------- next part -------------- An HTML attachment was scrubbed... URL: From Martin.Maly at microsoft.com Wed Oct 19 14:33:43 2005 From: Martin.Maly at microsoft.com (Martin Maly) Date: Wed, 19 Oct 2005 05:33:43 -0700 Subject: [IronPython] users Digest, Vol 15, Issue 16 In-Reply-To: <7fed9b030510190422idc5e11dg28ca9adf21ccaf@mail.gmail.com> Message-ID: <1DFB396200705E46B5338CA4B2E25BDEA4B708@DF-BANDIT-MSG.exchange.corp.microsoft.com> I am just making a wild guess here, but do you have the Windows Presentation Framework installed? If not, you can get it at: http://msdn.microsoft.com/windowsvista/getthebeta/default.aspx Martin ________________________________ From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Crest Sent: Wednesday, October 19, 2005 1:23 PM To: users at lists.ironpython.com Subject: Re: [IronPython] users Digest, Vol 15, Issue 16 Sorry. ------------------------------------------------------------------------ ----- G:\Pythons\IronPy>ipc wpf.py Traceback (most recent call last): at __main__.Initialize() in G:\Pythons\IronPy\wpf.py:line 2 RuntimeError: Could not load assembly WindowsBase ------------------------------------------------------------------------ ------ ipc => IronPythonConsole -------------- next part -------------- An HTML attachment was scrubbed... URL: From alang.yl at gmail.com Wed Oct 19 15:13:17 2005 From: alang.yl at gmail.com (Crest) Date: Wed, 19 Oct 2005 21:13:17 +0800 Subject: [IronPython] users Digest, Vol 15, Issue 16 In-Reply-To: <7fed9b030510190422idc5e11dg28ca9adf21ccaf@mail.gmail.com> References: <7fed9b030510190422idc5e11dg28ca9adf21ccaf@mail.gmail.com> Message-ID: <7fed9b030510190613s2783896at4d854f263c089a7@mail.gmail.com> > > RuntimeError: Could not load assembly WindowsBase > Oh,I see. The "WindowsBase" is belonged to Mono. -- My BLOG http://blog.sina.com.cn/u/1418287653 -------------- next part -------------- An HTML attachment was scrubbed... URL: From arkman3112 at gmail.com Wed Oct 19 16:24:05 2005 From: arkman3112 at gmail.com (Greg Kerr) Date: Wed, 19 Oct 2005 09:24:05 -0500 Subject: [IronPython] users Digest, Vol 15, Issue 16 References: <7fed9b030510190422idc5e11dg28ca9adf21ccaf@mail.gmail.com> <7fed9b030510190613s2783896at4d854f263c089a7@mail.gmail.com> Message-ID: WindowsBase is a part of WinFX and should be in your GAC if you've installed at least the Sep CTP runtime components as per Martin's posted link. "Crest" wrote in message news:7fed9b030510190613s2783896at4d854f263c089a7 at mail.gmail.com... RuntimeError: Could not load assembly WindowsBase Oh,I see. The "WindowsBase" is belonged to Mono. -- My BLOG http://blog.sina.com.cn/u/1418287653 ------------------------------------------------------------------------------ _______________________________________________ users mailing list users at lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From richard.hsu at gmail.com Fri Oct 21 03:03:28 2005 From: richard.hsu at gmail.com (Richard Hsu) Date: Thu, 20 Oct 2005 21:03:28 -0400 Subject: [IronPython] IronPython and WPF .. too cool In-Reply-To: References: Message-ID: <43583E60.50605@gmail.com> Thanks Greg!! I had install Avalon as a pre-requisite for Microsoft Max but haven yet come around to playing with this new API. Thank you for getting me half way into it with this simple app. Cool!! -- Richard Hsu > Message: 1 > Date: Tue, 18 Oct 2005 13:38:19 -0500 > From: "Greg Kerr" > Subject: [IronPython] IronPython and WPF .. too cool > To: users-ironpython.com at lists.ironpython.com > Message-ID: > > Don't know if anyone wants to see it, or if everyone's way past it, but here > is a simple WPF app in IronPython: > > import sys > sys.LoadAssemblyByName( "WindowsBase") > sys.LoadAssemblyByName( "PresentationCore") > sys.LoadAssemblyByName( "PresentationFramework") > sys.LoadAssemblyByName( "UIAutomationProvider") > sys.LoadAssemblyByName( "UIAutomationTypes") > > from System import * > from System.Windows import * > from System.Windows.Controls import * > from System.Windows.Media import * > from System.Windows.Media.Animation import * > > class MyApp (Application): > > def __init__( self): > > pass > > def OnStartup( self, evt): > > mainWindow = Window(); > rootPanel = StackPanel(); > rootPanel.Background = SolidColorBrush( Colors.Green); > > txtElement = TextBlock() > txtElement.Margin = Thickness( 10) > txtElement.Text = "A TextBlock" > txtElement.FontSize = 24 > txtElement.Foreground = SolidColorBrush( Colors.White) > > mainWindow.Content = rootPanel > mainWindow.Title = "WPF Window from IronPython" > > rootPanel.Children.Add( txtElement) > > opacityAnim = DoubleAnimation( 0.0, > Duration(TimeSpan.FromMilliseconds(1000))) > opacityAnim.AutoReverse = True > opacityAnim.RepeatBehavior = RepeatBehavior.Forever > txtElement.BeginAnimation(Control.OpacityProperty, opacityAnim) > > mainWindow.Show() > > app = MyApp() > app.Run() From lattam at mac.com Sun Oct 23 08:01:00 2005 From: lattam at mac.com (Michael Latta) Date: Sat, 22 Oct 2005 23:01:00 -0700 Subject: [IronPython] Scripting use with security pointers wanted In-Reply-To: <43583E60.50605@gmail.com> Message-ID: <200510230601.j9N61f7a024833@mac.com> I would like to use IronPython for scripting, but that poses large security concerns. Any pointers would be welcome. 1) How to run the scripting code in a secure manner, but give it access to the public API needed to script the application. 2) How do I run IronPython code in a separate AppDomain? 3) How do I give that other app domain restricted access to my API? 4) How do I set it up so the app domain is running with low security privileges? Most of this is not specific to IronPython, but hopefully someone here has done this already. It would be great if there were a standard module/method for doing this out of the box. I could see having a generic class IronPythonScript that takes an API type and results in an object that manages the other app domain, and exposes an interface for loading and executing scripts, while providing an object of the API type to the scripts as a point of interface with the application. Michael From jvm_cop at spamcop.net Mon Oct 24 17:13:55 2005 From: jvm_cop at spamcop.net (J. Merrill) Date: Mon, 24 Oct 2005 11:13:55 -0400 Subject: [IronPython] Scripting use with security pointers wanted In-Reply-To: <200510230601.j9N61f7a024833@mac.com> References: <43583E60.50605@gmail.com> Message-ID: <4.3.2.7.2.20051024110718.05023318@mail.comcast.net> .Net has a notion called "code access security" that allows you to control what your code is able to do when called by someone else (and many other things). If you Google for "code access security" ".net" -- http://www.google.com/search?hl=en&lr=&q=%22code+access+security%22+%22.net%22 you'll see many pointers to discussions, documentation, and code samples. It should not be necessary to use another AppDomain to get the security you want. The only real advantage of using another AppDomain is that malicious code can cause a "denial of service" problem by misbehaving if it runs in the same AppDomain as your app; if the code is running in its own AppDomain, it won't affect things permanently because you can deal with it being non-responsive by shooting the other AppDomain. However, there are some restrictions on what can be done across AppDomains (related to the requirement that data be "marshalled" across the AppDomain boundary), and everything is (somewhat) slower than would be the case if everything's within the same AppDomain. Good luck... At 02:01 AM 10/23/2005, Michael Latta wrote >I would like to use IronPython for scripting, but that poses large security >concerns. >Any pointers would be welcome. > >1) How to run the scripting code in a secure manner, but give it access to >the public API needed to script the application. >2) How do I run IronPython code in a separate AppDomain? >3) How do I give that other app domain restricted access to my API? >4) How do I set it up so the app domain is running with low security >privileges? > >Most of this is not specific to IronPython, but hopefully someone here has >done this already. It would be great if there were a standard module/method >for doing this out of the box. I could see having a generic class >IronPythonScript that takes an API type and results in an object that >manages the other app domain, and exposes an interface for loading and >executing scripts, while providing an object of the API type to the scripts >as a point of interface with the application. > >Michael J. Merrill / Analytical Software Corp From Shawn.Farkas at microsoft.com Mon Oct 24 20:48:49 2005 From: Shawn.Farkas at microsoft.com (Shawn Farkas) Date: Mon, 24 Oct 2005 11:48:49 -0700 Subject: [IronPython] Scripting use with security pointers wanted In-Reply-To: <4.3.2.7.2.20051024110718.05023318@mail.comcast.net> Message-ID: Generally we do advocate creating a separate AppDomain for different trust levels -- trying to ensure that each AppDomain has at most two trust levels, FullTrust and one partial trust set. The reasoning is that any assembly in an AppDomain can access any other assembly loaded into the domain. Which means it is generally trivial for an assembly running at a low trust level to elevate its trust to a higher level by routing its calls via an assembly at a higher trust level. While FullTrust code is often audited for security when being called by partially trusted code, partial trust assemblies are generally not. That being said, seeing what it would take to get IronPython to run partial trust has been something I've been meaning to investigate for a while now -- its just been on the back burner. The actual Python engine itself will require FullTrust because IronMath.dll contains some unverifiable code. However that should not be a problem, as long as you can coerce the code generated for the Python scripts to run partial trust. That's where the issue lies -- since IronPython is using lightweight code gen, the code generated from the script runs in the same security context as the assembly it was emitted into -- in this case the fully trusted IronPython.dll In addition to partial trust issues, there is the possibility of marshalling issues that were pointed out previously in this thread. I imagine this will be a bit of an uphill battle at first, however a good start would be to recompile IronPython with a strong name, and use the new Simple Sandboxing API (http://blogs.msdn.com/shawnfa/archive/2005/08/08/449050.aspx) to create a partial trust sandbox that granted FullTrust to IronMath, and partial trust to IronPython to work around the above issue. Then some trial and error will be needed to see how well the Python engine works in partial trust. -Shawn http://blogs.msdn.com/shawnfa -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of J. Merrill Sent: Monday, October 24, 2005 8:14 AM To: Discussion of IronPython Subject: Re: [IronPython] Scripting use with security pointers wanted .Net has a notion called "code access security" that allows you to control what your code is able to do when called by someone else (and many other things). If you Google for "code access security" ".net" -- http://www.google.com/search?hl=en&lr=&q=%22code+access+security%22+%22.net%22 you'll see many pointers to discussions, documentation, and code samples. It should not be necessary to use another AppDomain to get the security you want. The only real advantage of using another AppDomain is that malicious code can cause a "denial of service" problem by misbehaving if it runs in the same AppDomain as your app; if the code is running in its own AppDomain, it won't affect things permanently because you can deal with it being non-responsive by shooting the other AppDomain. However, there are some restrictions on what can be done across AppDomains (related to the requirement that data be "marshalled" across the AppDomain boundary), and everything is (somewhat) slower than would be the case if everything's within the same AppDomain. Good luck... At 02:01 AM 10/23/2005, Michael Latta wrote >I would like to use IronPython for scripting, but that poses large security >concerns. >Any pointers would be welcome. > >1) How to run the scripting code in a secure manner, but give it access to >the public API needed to script the application. >2) How do I run IronPython code in a separate AppDomain? >3) How do I give that other app domain restricted access to my API? >4) How do I set it up so the app domain is running with low security >privileges? > >Most of this is not specific to IronPython, but hopefully someone here has >done this already. It would be great if there were a standard module/method >for doing this out of the box. I could see having a generic class >IronPythonScript that takes an API type and results in an object that >manages the other app domain, and exposes an interface for loading and >executing scripts, while providing an object of the API type to the scripts >as a point of interface with the application. > >Michael J. Merrill / Analytical Software Corp _______________________________________________ users mailing list users at lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com From lattam at mac.com Mon Oct 24 21:22:41 2005 From: lattam at mac.com (Michael Latta) Date: Mon, 24 Oct 2005 12:22:41 -0700 Subject: [IronPython] Scripting use with security pointers wanted In-Reply-To: Message-ID: <200510241923.j9OJNGGI017232@mac.com> Thanks for the pointers. I want to make sure my scriptable app is not creating security holes like ActiveX created in the past with full trust loaded content. At the same time there are aspects I would like to implement that require good performance. Using a general purpose language for app extension may be part of the issue. What I want is a language that can be used to add custom behavior to the app, but I want to restrict what that behavior can do to the public API my app exposes. At the same time, letting add-ons do advanced things can make the infrastructure much more adaptable and usable in the market. It is not practical to marshal the app data to another app domain, it might be reasonable to marshal action objects from the extension app domain to the application. This ensures that only approved actions execute in the application domain. But, then only those actions can affect the application. Either the actions need to be very basic and general (property access, etc), or the custom logic needs to execute in the application domain. I guess it really comes down to how much overhead is there for each API call to marshal an action object between app domains. I think this is going to require some experimentation to resolve. Michael -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Shawn Farkas Sent: Monday, October 24, 2005 11:49 AM To: Discussion of IronPython Subject: Re: [IronPython] Scripting use with security pointers wanted Generally we do advocate creating a separate AppDomain for different trust levels -- trying to ensure that each AppDomain has at most two trust levels, FullTrust and one partial trust set. The reasoning is that any assembly in an AppDomain can access any other assembly loaded into the domain. Which means it is generally trivial for an assembly running at a low trust level to elevate its trust to a higher level by routing its calls via an assembly at a higher trust level. While FullTrust code is often audited for security when being called by partially trusted code, partial trust assemblies are generally not. That being said, seeing what it would take to get IronPython to run partial trust has been something I've been meaning to investigate for a while now -- its just been on the back burner. The actual Python engine itself will require FullTrust because IronMath.dll contains some unverifiable code. However that should not be a problem, as long as you can coerce the code generated for the Python scripts to run partial trust. That's where the issue lies -- since IronPython is using lightweight code gen, the code generated from the script runs in the same security context as the assembly it was emitted into -- in this case the fully trusted IronPython.dll In addition to partial trust issues, there is the possibility of marshalling issues that were pointed out previously in this thread. I imagine this will be a bit of an uphill battle at first, however a good start would be to recompile IronPython with a strong name, and use the new Simple Sandboxing API (http://blogs.msdn.com/shawnfa/archive/2005/08/08/449050.aspx) to create a partial trust sandbox that granted FullTrust to IronMath, and partial trust to IronPython to work around the above issue. Then some trial and error will be needed to see how well the Python engine works in partial trust. -Shawn http://blogs.msdn.com/shawnfa -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of J. Merrill Sent: Monday, October 24, 2005 8:14 AM To: Discussion of IronPython Subject: Re: [IronPython] Scripting use with security pointers wanted .Net has a notion called "code access security" that allows you to control what your code is able to do when called by someone else (and many other things). If you Google for "code access security" ".net" -- http://www.google.com/search?hl=en&lr=&q=%22code+access+security%22+%22.net% 22 you'll see many pointers to discussions, documentation, and code samples. It should not be necessary to use another AppDomain to get the security you want. The only real advantage of using another AppDomain is that malicious code can cause a "denial of service" problem by misbehaving if it runs in the same AppDomain as your app; if the code is running in its own AppDomain, it won't affect things permanently because you can deal with it being non-responsive by shooting the other AppDomain. However, there are some restrictions on what can be done across AppDomains (related to the requirement that data be "marshalled" across the AppDomain boundary), and everything is (somewhat) slower than would be the case if everything's within the same AppDomain. Good luck... At 02:01 AM 10/23/2005, Michael Latta wrote >I would like to use IronPython for scripting, but that poses large security >concerns. >Any pointers would be welcome. > >1) How to run the scripting code in a secure manner, but give it access to >the public API needed to script the application. >2) How do I run IronPython code in a separate AppDomain? >3) How do I give that other app domain restricted access to my API? >4) How do I set it up so the app domain is running with low security >privileges? > >Most of this is not specific to IronPython, but hopefully someone here has >done this already. It would be great if there were a standard module/method >for doing this out of the box. I could see having a generic class >IronPythonScript that takes an API type and results in an object that >manages the other app domain, and exposes an interface for loading and >executing scripts, while providing an object of the API type to the scripts >as a point of interface with the application. > >Michael J. Merrill / Analytical Software Corp _______________________________________________ users mailing list users at lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com _______________________________________________ users mailing list users at lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com From pablodg at softhome.net Thu Oct 27 19:00:14 2005 From: pablodg at softhome.net (Pablo De Grande) Date: Thu, 27 Oct 2005 14:00:14 -0300 Subject: [IronPython] Hi In-Reply-To: References: Message-ID: <6.2.1.2.2.20051027135404.054fe598@pop.softhome.net> Hi. I am new to the list, and I am not sure this is the right place to report issues. Just in case, 2 issues: - %i appeared as not supported. I had to replace it by %d (in a format expression) - splitlines appeared as not supported. I had to replace it by split('\n') They are not big deal, but for real projects changing others code to meet my compiler could not be an option.... Byebye, P. ps: by the way, the code performed more than 2 times slower than running standard python... I am pretty much a dotnet fan, so I'd love running my code under .net.... so feel free to ask me for the code in case you need performance cases to tune the thing better.... At 01:43 PM 10/27/2005, users-request at lists.ironpython.com wrote: >Welcome to the users at lists.ironpython.com mailing list! > >To post to this list, send your email to: > > users at lists.ironpython.com > >General information about the mailing list is at: > > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > >If you ever want to unsubscribe or change your options (eg, switch to >or from digest mode, change your password, etc.), visit your >subscription page at: > > http://lists.ironpython.com/options.cgi/users-ironpython.com/pablodg%40softhome.net > > >You can also make such adjustments via email by sending a message to: > > users-request at lists.ironpython.com > >with the word `help' in the subject or body (don't include the >quotes), and you will get back a message with instructions. > >You must know your password to change your options (including changing >the password, itself) or to unsubscribe. It is: > > bloclo > >Normally, Mailman will remind you of your lists.ironpython.com mailing >list passwords once every month, although you can disable this if you >prefer. This reminder will also include instructions on how to >unsubscribe or change your account options. There is also a button on >your options page that will email your current password to you. From kfarmer at thuban.org Fri Oct 28 00:02:01 2005 From: kfarmer at thuban.org (Keith J. Farmer) Date: Thu, 27 Oct 2005 15:02:01 -0700 Subject: [IronPython] Hi References: <6.2.1.2.2.20051027135404.054fe598@pop.softhome.net> Message-ID: If you check the archives, JimH recently posted an analysis of some performance issues which may relate to what you've encountered. -------------- next part -------------- A non-text attachment was scrubbed... Name: winmail.dat Type: application/ms-tnef Size: 2904 bytes Desc: not available URL: From ml.cyresse at gmail.com Sat Oct 29 15:39:49 2005 From: ml.cyresse at gmail.com (Liam Clarke) Date: Sun, 30 Oct 2005 02:39:49 +1300 Subject: [IronPython] IronPython and WPF .. too cool Message-ID: Hi all, I'd just to like take a wee moment to say "Hi", first post etc. After hearing rumours about IronPython, I decided to actually find out what the fuss about the whole .NET thing was, and IronPython seemed the perfect way. Must say, very impressed with the .NET shebang, and how simply IronPython works with it. It's great to learn a new framework while remaining within my comfort zone, as I've only been coding a year, and solely in Python. As of finding this advice from Jim Hugunin in the list's archive: ---- site.py ---- import sys sys.path.append('c://Python24//Lib') ----------------- I am a very happy panda. Anyway, I was responding to the above post, and I'd like to say thank you to the OP. I downloaded and had a look at WFP/Avalon, or whatever it's properly called, and wow. Awesome. Kudos to MS for a coherent and what looks to be incredibly powerful GUI API. From my Python background I can only describe it as the ease of use of Tkinter with the power of wxPython, although it'd probably be better to say it's easier to use than Tkinter, and more powerful than wxPython on a Win32 platform. Out of curiosity, are there any docs for it yet? I managed to find some brief introductions and a hitch-hiker's guide on MSDN... but with some assumptions (and I'm also pleasantly surprised that WFP is quite intuitive) and use of Reflector(www.aisto.com/roeder/dotnet/) I managed to tweak a few things here and there, so I thought I'd post them up for general consumption if there isn't any docs yet. To change the font of the TextBlock - txtElement.Text = "Look Ma, it's Courier New" txtElement.FontFamily = FontFamily("Courier New") #or other installed font And to add an icon or tooltip - mainWindow.Icon = IconData("c:/games/RA2/RA2.ico") mainWindow.ToolTip = "Yes, it's the Red Alert 2 icon..." I think there's more than one way to specify the icon, but I chose the simplest. There's a whole bunch of other font stuff too, FontStyle etc. I also ran a dir() on the textblock, panel, and window objects, and between them there's about 1500 attributes, but it's good to have a browse and find a point to start guessing from. Regards, Liam Clarke From Shawn.Farkas at microsoft.com Mon Oct 31 19:21:45 2005 From: Shawn.Farkas at microsoft.com (Shawn Farkas) Date: Mon, 31 Oct 2005 10:21:45 -0800 Subject: [IronPython] IronPython and WPF .. too cool In-Reply-To: Message-ID: Hi Liam, You can check out http://winfx.msdn.microsoft.com/library/default.asp?url=/library/en-us/portals/html/7579a80a-fd14-440f-b6f7-a1193e100598.asp for links to WPF docs. In general the pre-release docs for WinFX (including WPF and WCF) are on http://winfx.msdm.microsoft.com -Shawn -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Liam Clarke Sent: Saturday, October 29, 2005 6:40 AM To: users at lists.ironpython.com Subject: Re: [IronPython] IronPython and WPF .. too cool Hi all, I'd just to like take a wee moment to say "Hi", first post etc. After hearing rumours about IronPython, I decided to actually find out what the fuss about the whole .NET thing was, and IronPython seemed the perfect way. Must say, very impressed with the .NET shebang, and how simply IronPython works with it. It's great to learn a new framework while remaining within my comfort zone, as I've only been coding a year, and solely in Python. As of finding this advice from Jim Hugunin in the list's archive: ---- site.py ---- import sys sys.path.append('c://Python24//Lib') ----------------- I am a very happy panda. Anyway, I was responding to the above post, and I'd like to say thank you to the OP. I downloaded and had a look at WFP/Avalon, or whatever it's properly called, and wow. Awesome. Kudos to MS for a coherent and what looks to be incredibly powerful GUI API. From my Python background I can only describe it as the ease of use of Tkinter with the power of wxPython, although it'd probably be better to say it's easier to use than Tkinter, and more powerful than wxPython on a Win32 platform. Out of curiosity, are there any docs for it yet? I managed to find some brief introductions and a hitch-hiker's guide on MSDN... but with some assumptions (and I'm also pleasantly surprised that WFP is quite intuitive) and use of Reflector(www.aisto.com/roeder/dotnet/) I managed to tweak a few things here and there, so I thought I'd post them up for general consumption if there isn't any docs yet. To change the font of the TextBlock - txtElement.Text = "Look Ma, it's Courier New" txtElement.FontFamily = FontFamily("Courier New") #or other installed font And to add an icon or tooltip - mainWindow.Icon = IconData("c:/games/RA2/RA2.ico") mainWindow.ToolTip = "Yes, it's the Red Alert 2 icon..." I think there's more than one way to specify the icon, but I chose the simplest. There's a whole bunch of other font stuff too, FontStyle etc. I also ran a dir() on the textblock, panel, and window objects, and between them there's about 1500 attributes, but it's good to have a browse and find a point to start guessing from. Regards, Liam Clarke _______________________________________________ users mailing list users at lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com From freddiewitherden at hotmail.com Fri Oct 14 20:28:58 2005 From: freddiewitherden at hotmail.com (Freddie Witherden) Date: Fri, 14 Oct 2005 18:28:58 -0000 Subject: [IronPython] devenv In-Reply-To: <1DFB396200705E46B5338CA4B2E25BDE9E78CD@DF-BANDIT-MSG.exchange.corp.microsoft.com> Message-ID: Does anyone have a list of modules which are currently supported? >From: Martin Maly >Reply-To: Discussion of IronPython >To: "Discussion of IronPython" >Subject: Re: [IronPython] devenv >Date: Tue, 11 Oct 2005 21:58:09 -0700 >MIME-Version: 1.0 >Received: from one.mx.123-reg.co.uk ([195.224.48.126]) by >mc9-f12.hotmail.com with Microsoft SMTPSVC(6.0.3790.211); Tue, 11 Oct 2005 >21:58:21 -0700 >Received: from [66.33.216.23] (helo=che.dreamhost.com)by >one.mx.123-reg.co.uk with esmtp (Exim 4.50)id 1EPYh1-0002TE-H3for >freddie at pislice.com; Wed, 12 Oct 2005 05:58:20 +0100 >Received: from che.dreamhost.com (localhost [127.0.0.1])by >che.dreamhost.com (Postfix) with ESMTPid 985D51BB68; Tue, 11 Oct 2005 >21:58:16 -0700 (PDT) >Received: from mail1.exchange.microsoft.com >(mail1.exchange.microsoft.com[131.107.76.156])by che.dreamhost.com >(Postfix) with ESMTP id 2F3871BB5Bfor ; Tue, 11 >Oct 2005 21:58:13 -0700 (PDT) >Received: from DF-GWY-04.Exchange.Corp.Microsoft.com ([157.54.8.149]) >bymail1.exchange.microsoft.com over TLS secured channel withMicrosoft >SMTPSVC(6.0.3790.1830); Tue, 11 Oct 2005 21:58:12 -0700 >Received: from df-hub-02.exchange.corp.microsoft.com (157.54.8.23) >byDF-GWY-04.Exchange.Corp.microsoft.com (157.54.8.149) with MicrosoftSMTP >Server id 8.0.360.16; Wed, 12 Oct 2005 04:58:12 +0000 >Received: from df-hub-01.exchange.corp.microsoft.com ([157.54.8.109]) >bydf-hub-02.exchange.corp.microsoft.com with >MicrosoftSMTPSVC(6.0.3790.1830); Tue, 11 Oct 2005 21:58:12 -0700 >Received: from DF-BANDIT-BHD.Exchange.Microsoft.com ([157.54.54.229]) >bydf-hub-01.exchange.corp.microsoft.com over TLS secured channel >withMicrosoft SMTPSVC(6.0.3790.1830); Tue, 11 Oct 2005 21:58:12 -0700 >X-Message-Info: JGTYoYF78jEIdSlUpmXixO8efaCCMQcmOIAAFn/mIIU= >Delivered-To: users-ironpython.com at che.dreamhost.com >x-originalarrivaltime: 12 Oct 2005 04:58:12.0076 >(UTC)FILETIME=[8BF5A2C0:01C5CEE9] >X-MimeOLE: Produced By Microsoft Exchange V6.5 >Content-Class: urn:content-classes:message >X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: [IronPython] devenv >Thread-Index: AcXDz7OX02/mD5nqRfynG4taVR5IfALE8/DgAAFTVCAAACPzsA== >X-BeenThere: users at lists.ironpython.com >X-Mailman-Version: 2.1.6 >Precedence: list >List-Id: Discussion of IronPython >List-Unsubscribe: >, >List-Archive: >List-Post: >List-Help: >List-Subscribe: >, >Errors-To: users-bounces at lists.ironpython.com >Return-Path: users-bounces at lists.ironpython.com > >We are hoping to be very close by the end of the year... > > > >Martin > > > >________________________________ > >From: users-bounces at lists.ironpython.com >[mailto:users-bounces at lists.ironpython.com] On Behalf Of Keith J. Farmer >Sent: Tuesday, October 11, 2005 9:54 PM >To: Discussion of IronPython >Subject: Re: [IronPython] devenv > > > >Idea of how long until parity levels with CPython and the standard >library are reached? > > > > >----- > >Keith J. Farmer > >kfarmer at thuban.org > >________________________________ > >From: users-bounces at lists.ironpython.com >[mailto:users-bounces at lists.ironpython.com] On Behalf Of Martin Maly >Sent: Tuesday, 11 October 2005 21:23 > >also embedded IronPython and used it as a scripting engine for their >applications. As for the standalone use, my feeling is that to fully >enable the scenario, we need to run many more standard Python modules. >We are getting there > > > >_______________________________________________ >users mailing list >users at lists.ironpython.com >http://lists.ironpython.com/listinfo.cgi/users-ironpython.com From gurkanyeniceri at analystdeveloper.com Tue Oct 18 13:54:35 2005 From: gurkanyeniceri at analystdeveloper.com (Gurkan Yeniceri) Date: Tue, 18 Oct 2005 21:54:35 +1000 Subject: [IronPython] new addition Message-ID: Hi People, I have just joined to the list. I have downloaded the Iron Python but don't know where to start. Is there a beginner's web site somewhere? Gurkan Yeniceri Analyst Developer www.analystdeveloper.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From papanii at somuah.com Sat Oct 15 05:26:07 2005 From: papanii at somuah.com (Papanii Okai) Date: Sat, 15 Oct 2005 03:26:07 -0000 Subject: [IronPython] importing os module Message-ID: <001401c5d138$2ce81c30$0138fea9@goku> Hi Guys, I was testing out Iron Python and I was trying to test out the OS module but I got the error .. TraceBack (most recent call last) At ImportError: No module named os.. Obviously it doesn't exist. Thus is there any means to get around this? Thank you --Papanii -------------- next part -------------- An HTML attachment was scrubbed... URL: From raj86 at streamyx.com Thu Oct 13 12:47:04 2005 From: raj86 at streamyx.com (S.Rajesh) Date: Thu, 13 Oct 2005 10:47:04 -0000 Subject: [IronPython] Need help in learning. Message-ID: <434E3B34.3030607@streamyx.com> Hi, I am familiar with python but not with .NET. I also do not know other programming languages like VB or C# so it is not that easy to follow tutorials. What should be my first step to learn to use ironpython? Thank You. From Martin.Maly at microsoft.com Mon Oct 31 19:48:31 2005 From: Martin.Maly at microsoft.com (Martin Maly) Date: Mon, 31 Oct 2005 10:48:31 -0800 Subject: [IronPython] importing os module In-Reply-To: <001401c5d138$2ce81c30$0138fea9@goku> Message-ID: <5C0A6F919D675745BB1DBA7412DB68F5295555@df-foxhound-msg.exchange.corp.microsoft.com> You can set sys.path to point to CPython's Lib directory which includes os module: >>> import sys >>> sys.path.append("C:\\Python24\Lib") >>> import os >>> os.name 'nt' You can even put the first 2 lines into your site.py (located in IronPython's Bin\lib directory) Martin ________________________________ From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Papanii Okai Sent: Friday, October 14, 2005 8:26 PM To: users at lists.ironpython.com Subject: [IronPython] importing os module Hi Guys, I was testing out Iron Python and I was trying to test out the OS module but I got the error .. TraceBack (most recent call last) At ImportError: No module named os.. Obviously it doesn't exist. Thus is there any means to get around this? Thank you --Papanii -------------- next part -------------- An HTML attachment was scrubbed... URL: From gogins at pipeline.com Mon Oct 31 19:49:21 2005 From: gogins at pipeline.com (Michael Gogins) Date: Mon, 31 Oct 2005 13:49:21 -0500 (GMT-05:00) Subject: [IronPython] Need help in learning. Message-ID: <31828497.1130784561289.JavaMail.root@mswamui-chipeau.atl.sa.earthlink.net> IronPython is not quite "finished" so your best bet would be to go through the Python tutorial at www.python.org first. Then you will understand what is happening with regular Python and be in better shape to deal with what is and what is not finished or working in IronPython. Regards, Mike -----Original Message----- From: "S.Rajesh" Sent: Oct 13, 2005 5:47 AM To: users at lists.ironpython.com Subject: [IronPython] Need help in learning. Hi, I am familiar with python but not with .NET. I also do not know other programming languages like VB or C# so it is not that easy to follow tutorials. What should be my first step to learn to use ironpython? Thank You. _______________________________________________ users mailing list users at lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com From weatherby.mayfield at eds.com Mon Oct 31 20:05:44 2005 From: weatherby.mayfield at eds.com (Mayfield, Weatherby) Date: Mon, 31 Oct 2005 13:05:44 -0600 Subject: [IronPython] Need help in learning. Message-ID: <0863B2713889324B8205EDAA034703A3018F81DB@usplm235.amer.corp.eds.com> I am in a similar boat with regard to knowing some Python but very little .NET. I'm very intrigued by the ability to access the .NET framework from Python, but I know so little about .NET I'm not even sure what question(s) to ask. >From what I have seen in the examples and archives, it looks like there are two basic ways to get at the .NET code: LoadAssemblyByName and LoadAssemblyFromFile. My problem is that I don't know how to correlate between the assembly names or file names and the .NET APIs I read about. Is there somewhere I can look on MSDN or in a manual or in Visual Studio that will tell me if I want to access 'X' .NET feature then the assembly name is 'Y' or the file name is 'Z'? I think I must be searching for the wrong terms or something. Thanks, Web Mayfield -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of S.Rajesh Sent: Thursday, October 13, 2005 5:47 AM To: users at lists.ironpython.com Subject: [IronPython] Need help in learning. Hi, I am familiar with python but not with .NET. I also do not know other programming languages like VB or C# so it is not that easy to follow tutorials. What should be my first step to learn to use ironpython? Thank You. _______________________________________________ users mailing list users at lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com From Shawn.Farkas at microsoft.com Mon Oct 31 20:11:50 2005 From: Shawn.Farkas at microsoft.com (Shawn Farkas) Date: Mon, 31 Oct 2005 11:11:50 -0800 Subject: [IronPython] Need help in learning. In-Reply-To: <0863B2713889324B8205EDAA034703A3018F81DB@usplm235.amer.corp.eds.com> Message-ID: Sure -- you just have to go to the MSDN docs for the class you're using. For instance, if you want to use the System.Security.Cryptography.SignedXml.ComputeSignature() method, you would go to the MSDN documentation for "SignedXml Class" (http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/frlrfsystemsecuritycryptographyxmlsignedxmlclasstopic.asp) and then at the bottom of the page, in the requirements section is: Assembly: System.Security (in System.Security.dll) -Shawn -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Mayfield, Weatherby Sent: Monday, October 31, 2005 11:06 AM To: Discussion of IronPython Subject: Re: [IronPython] Need help in learning. I am in a similar boat with regard to knowing some Python but very little .NET. I'm very intrigued by the ability to access the .NET framework from Python, but I know so little about .NET I'm not even sure what question(s) to ask. >From what I have seen in the examples and archives, it looks like there are two basic ways to get at the .NET code: LoadAssemblyByName and LoadAssemblyFromFile. My problem is that I don't know how to correlate between the assembly names or file names and the .NET APIs I read about. Is there somewhere I can look on MSDN or in a manual or in Visual Studio that will tell me if I want to access 'X' .NET feature then the assembly name is 'Y' or the file name is 'Z'? I think I must be searching for the wrong terms or something. Thanks, Web Mayfield -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of S.Rajesh Sent: Thursday, October 13, 2005 5:47 AM To: users at lists.ironpython.com Subject: [IronPython] Need help in learning. Hi, I am familiar with python but not with .NET. I also do not know other programming languages like VB or C# so it is not that easy to follow tutorials. What should be my first step to learn to use ironpython? Thank You. _______________________________________________ users mailing list users at lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com _______________________________________________ users mailing list users at lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com From jhalleux at exchange.microsoft.com Mon Oct 31 20:48:13 2005 From: jhalleux at exchange.microsoft.com (Peli de Halleux (PELI)) Date: Mon, 31 Oct 2005 11:48:13 -0800 Subject: [IronPython] Need help in learning. In-Reply-To: References: <0863B2713889324B8205EDAA034703A3018F81DB@usplm235.amer.corp.eds.com>, Message-ID: Following up the improving the experience for new .Net users, IronPython could provide specialized commands to search msdn and pop up a internet window. For example something like msdn "System.Security.Cryptography.SignedXml.ComputeSignature" // search based on literal msdn foo // search based on the object type ________________________________________ From: users-bounces at lists.ironpython.com On Behalf Of Shawn Farkas Sent: Monday, October 31, 2005 11:11 AM To: Discussion of IronPython Subject: Re: [IronPython] Need help in learning. Sure -- you just have to go to the MSDN docs for the class you're using. For instance, if you want to use the System.Security.Cryptography.SignedXml.ComputeSignature() method, you would go to the MSDN documentation for "SignedXml Class" (http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/frlrfsystemsecuritycryptographyxmlsignedxmlclasstopic.asp) and then at the bottom of the page, in the requirements section is: Assembly: System.Security (in System.Security.dll) -Shawn -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Mayfield, Weatherby Sent: Monday, October 31, 2005 11:06 AM To: Discussion of IronPython Subject: Re: [IronPython] Need help in learning. I am in a similar boat with regard to knowing some Python but very little .NET. I'm very intrigued by the ability to access the .NET framework from Python, but I know so little about .NET I'm not even sure what question(s) to ask. >From what I have seen in the examples and archives, it looks like there are two basic ways to get at the .NET code: LoadAssemblyByName and LoadAssemblyFromFile. My problem is that I don't know how to correlate between the assembly names or file names and the .NET APIs I read about. Is there somewhere I can look on MSDN or in a manual or in Visual Studio that will tell me if I want to access 'X' .NET feature then the assembly name is 'Y' or the file name is 'Z'? I think I must be searching for the wrong terms or something. Thanks, Web Mayfield -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of S.Rajesh Sent: Thursday, October 13, 2005 5:47 AM To: users at lists.ironpython.com Subject: [IronPython] Need help in learning. Hi, I am familiar with python but not with .NET. I also do not know other programming languages like VB or C# so it is not that easy to follow tutorials. What should be my first step to learn to use ironpython? Thank You. _______________________________________________ users mailing list users at lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com _______________________________________________ users mailing list users at lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com _______________________________________________ users mailing list users at lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From Shawn.Farkas at microsoft.com Mon Oct 31 21:27:47 2005 From: Shawn.Farkas at microsoft.com (Shawn Farkas) Date: Mon, 31 Oct 2005 12:27:47 -0800 Subject: [IronPython] Need help in learning. In-Reply-To: Message-ID: Pretty easily done with a quick script: import sys sys.LoadAssemblyByName("System") from System import String from System.Diagnostics import Process def msdn(query): if query.GetType() == String.Empty.GetType(): Process.Start("http://search.microsoft.com/search/results.aspx?View=msdn&st=b&c=4&s=1&swc=4&qu=" + query) else: msdn(query.GetType().FullName) Will launch the MSDN help page in the user's default browser. I'm not sure if there's a nicer way to determine if the parameter is a string or not, and this also relies on the fact that the browser will normalize the query string (if it contains a space for instance) ... but will break if you query contains the & character. However, for debugging purposes, if you throw that in your site.py you're all set J -Shawn ________________________________ From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Peli de Halleux (PELI) Sent: Monday, October 31, 2005 11:48 AM To: Discussion of IronPython Subject: Re: [IronPython] Need help in learning. Following up the improving the experience for new .Net users, IronPython could provide specialized commands to search msdn and pop up a internet window. For example something like msdn "System.Security.Cryptography.SignedXml.ComputeSignature" // search based on literal msdn foo // search based on the object type ________________________________________ From: users-bounces at lists.ironpython.com On Behalf Of Shawn Farkas Sent: Monday, October 31, 2005 11:11 AM To: Discussion of IronPython Subject: Re: [IronPython] Need help in learning. Sure -- you just have to go to the MSDN docs for the class you're using. For instance, if you want to use the System.Security.Cryptography.SignedXml.ComputeSignature() method, you would go to the MSDN documentation for "SignedXml Class" (http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/frlrfsystemsecuritycryptographyxmlsignedxmlclasstopic.asp) and then at the bottom of the page, in the requirements section is: Assembly: System.Security (in System.Security.dll) -Shawn -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Mayfield, Weatherby Sent: Monday, October 31, 2005 11:06 AM To: Discussion of IronPython Subject: Re: [IronPython] Need help in learning. I am in a similar boat with regard to knowing some Python but very little .NET. I'm very intrigued by the ability to access the .NET framework from Python, but I know so little about .NET I'm not even sure what question(s) to ask. >From what I have seen in the examples and archives, it looks like there are two basic ways to get at the .NET code: LoadAssemblyByName and LoadAssemblyFromFile. My problem is that I don't know how to correlate between the assembly names or file names and the .NET APIs I read about. Is there somewhere I can look on MSDN or in a manual or in Visual Studio that will tell me if I want to access 'X' .NET feature then the assembly name is 'Y' or the file name is 'Z'? I think I must be searching for the wrong terms or something. Thanks, Web Mayfield -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of S.Rajesh Sent: Thursday, October 13, 2005 5:47 AM To: users at lists.ironpython.com Subject: [IronPython] Need help in learning. Hi, I am familiar with python but not with .NET. I also do not know other programming languages like VB or C# so it is not that easy to follow tutorials. What should be my first step to learn to use ironpython? Thank You. _______________________________________________ users mailing list users at lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com _______________________________________________ users mailing list users at lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com _______________________________________________ users mailing list users at lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From almondb at gmail.com Mon Oct 31 21:49:41 2005 From: almondb at gmail.com (Brian) Date: Mon, 31 Oct 2005 12:49:41 -0800 Subject: [IronPython] IronPython and WPF .. too cool In-Reply-To: References: Message-ID: <21f1e2700510311249kee427d2n9d7618c11bcc9676@mail.gmail.com> I think there's a recent book out on WPF as well by Oreilly. On 10/31/05, Shawn Farkas wrote: > Hi Liam, > > You can check out http://winfx.msdn.microsoft.com/library/default.asp?url=/library/en-us/portals/html/7579a80a-fd14-440f-b6f7-a1193e100598.asp for links to WPF docs. > > In general the pre-release docs for WinFX (including WPF and WCF) are on http://winfx.msdm.microsoft.com > > -Shawn > > -----Original Message----- > From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Liam Clarke > Sent: Saturday, October 29, 2005 6:40 AM > To: users at lists.ironpython.com > Subject: Re: [IronPython] IronPython and WPF .. too cool > > Hi all, > > I'd just to like take a wee moment to say "Hi", first post etc. After > hearing rumours about IronPython, I decided to actually find out what > the fuss about the whole .NET thing was, and IronPython seemed the > perfect way. > > Must say, very impressed with the .NET shebang, and how simply > IronPython works with it. > It's great to learn a new framework while remaining within my comfort > zone, as I've only been coding a year, and solely in Python. > > As of finding this advice from Jim Hugunin in the list's archive: > ---- site.py ---- > import sys > sys.path.append('c://Python24//Lib') > ----------------- > > I am a very happy panda. Anyway, I was responding to the above post, > and I'd like to say thank you to the OP. I downloaded and had a look > at WFP/Avalon, or whatever it's properly called, and wow. Awesome. > Kudos to MS for a coherent and what looks to be incredibly powerful > GUI API. From my Python background I can only describe it as the ease > of use of Tkinter with the power of wxPython, although it'd probably > be better to say it's easier to use than Tkinter, and more powerful > than wxPython on a Win32 platform. > > Out of curiosity, are there any docs for it yet? I managed to find > some brief introductions and a hitch-hiker's guide on MSDN... but with > some assumptions (and I'm also pleasantly surprised that WFP is quite > intuitive) and use of Reflector(www.aisto.com/roeder/dotnet/) I > managed to tweak a few things here and there, so I thought I'd post > them up for general consumption if there isn't any docs yet. > > To change the font of the TextBlock - > > txtElement.Text = "Look Ma, it's Courier New" > txtElement.FontFamily = FontFamily("Courier New") #or other installed font > > And to add an icon or tooltip - > > mainWindow.Icon = IconData("c:/games/RA2/RA2.ico") > mainWindow.ToolTip = "Yes, it's the Red Alert 2 icon..." > > I think there's more than one way to specify the icon, but I chose the > simplest. > There's a whole bunch of other font stuff too, FontStyle etc. > > I also ran a dir() on the textblock, panel, and window objects, and > between them there's about 1500 attributes, but it's good to have a > browse and find a point to start guessing from. > > Regards, > > Liam Clarke > _______________________________________________ > users mailing list > users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > _______________________________________________ > users mailing list > users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > From jhalleux at exchange.microsoft.com Mon Oct 31 22:35:43 2005 From: jhalleux at exchange.microsoft.com (Peli de Halleux (PELI)) Date: Mon, 31 Oct 2005 13:35:43 -0800 Subject: [IronPython] Need help in learning. In-Reply-To: References: , Message-ID: Slick. ________________________________ From: users-bounces at lists.ironpython.com On Behalf Of Shawn Farkas Sent: Monday, October 31, 2005 12:27 PM To: Discussion of IronPython Subject: Re: [IronPython] Need help in learning. Pretty easily done with a quick script: import sys sys.LoadAssemblyByName("System") from System import String from System.Diagnostics import Process def msdn(query): if query.GetType() == String.Empty.GetType(): Process.Start("http://search.microsoft.com/search/results.aspx?View=msdn&st=b&c=4&s=1&swc=4&qu=" + query) else: msdn(query.GetType().FullName) Will launch the MSDN help page in the user's default browser. I'm not sure if there's a nicer way to determine if the parameter is a string or not, and this also relies on the fact that the browser will normalize the query string (if it contains a space for instance) ... but will break if you query contains the & character. However, for debugging purposes, if you throw that in your site.py you're all set J -Shawn ________________________________ From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Peli de Halleux (PELI) Sent: Monday, October 31, 2005 11:48 AM To: Discussion of IronPython Subject: Re: [IronPython] Need help in learning. Following up the improving the experience for new .Net users, IronPython could provide specialized commands to search msdn and pop up a internet window. For example something like msdn "System.Security.Cryptography.SignedXml.ComputeSignature" // search based on literal msdn foo // search based on the object type ________________________________________ From: users-bounces at lists.ironpython.com On Behalf Of Shawn Farkas Sent: Monday, October 31, 2005 11:11 AM To: Discussion of IronPython Subject: Re: [IronPython] Need help in learning. Sure -- you just have to go to the MSDN docs for the class you're using. For instance, if you want to use the System.Security.Cryptography.SignedXml.ComputeSignature() method, you would go to the MSDN documentation for "SignedXml Class" (http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/frlrfsystemsecuritycryptographyxmlsignedxmlclasstopic.asp) and then at the bottom of the page, in the requirements section is: Assembly: System.Security (in System.Security.dll) -Shawn -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Mayfield, Weatherby Sent: Monday, October 31, 2005 11:06 AM To: Discussion of IronPython Subject: Re: [IronPython] Need help in learning. I am in a similar boat with regard to knowing some Python but very little .NET. I'm very intrigued by the ability to access the .NET framework from Python, but I know so little about .NET I'm not even sure what question(s) to ask. >From what I have seen in the examples and archives, it looks like there are two basic ways to get at the .NET code: LoadAssemblyByName and LoadAssemblyFromFile. My problem is that I don't know how to correlate between the assembly names or file names and the .NET APIs I read about. Is there somewhere I can look on MSDN or in a manual or in Visual Studio that will tell me if I want to access 'X' .NET feature then the assembly name is 'Y' or the file name is 'Z'? I think I must be searching for the wrong terms or something. Thanks, Web Mayfield -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of S.Rajesh Sent: Thursday, October 13, 2005 5:47 AM To: users at lists.ironpython.com Subject: [IronPython] Need help in learning. Hi, I am familiar with python but not with .NET. I also do not know other programming languages like VB or C# so it is not that easy to follow tutorials. What should be my first step to learn to use ironpython? Thank You. _______________________________________________ users mailing list users at lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com _______________________________________________ users mailing list users at lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com _______________________________________________ users mailing list users at lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From jhalleux at exchange.microsoft.com Mon Oct 31 20:10:38 2005 From: jhalleux at exchange.microsoft.com (Peli de Halleux (PELI)) Date: Mon, 31 Oct 2005 11:10:38 -0800 Subject: [IronPython] Console for WinForms Message-ID: Is there a plan to add a WinForms console control in the IronPython? I stumboled on this problem last week and it is suprisingly hard to get a winform control to act as a console app! -------------- next part -------------- An HTML attachment was scrubbed... URL: