From no_reply at codeplex.com Tue Nov 1 09:03:36 2011 From: no_reply at codeplex.com (no_reply at codeplex.com) Date: 1 Nov 2011 01:03:36 -0700 Subject: [Ironpython-users] IronPython, Daily Digest 10/31/2011 Message-ID: Hi ironpython, Here's your Daily Digest of new issues for project "IronPython". In today's digest:ISSUES 1. [New issue] How to access public interface in .NET DLL ---------------------------------------------- ISSUES 1. [New issue] How to access public interface in .NET DLL http://ironpython.codeplex.com/workitem/31661 User hpweiss has proposed the issue: "The following interface is defined by the generatedProxy.cs file for my WCS Service [System.CodeDom.Compiler.GeneratedCodeAttribute("System.ServiceModel", "4.0.0.0")] public interface IAssayServiceContractCallback { [System.ServiceModel.OperationContractAttribute(IsOneWay=true, Action="http://XFEService/IAssayServiceContract/AvailableAssaysChangeNotification")] void AvailableAssaysChangeNotification(); } When I look in ildasm, I see the following ___[MOD] C:\_CodeElements\XFE\XFEServiceModel.dll ..... | |___[INT] IAssayServiceContractCallback | | .class interface public abstract auto ansi | | .custom instance void [System]System.CodeDom.Compiler.GeneratedCodeAttribute::.ctor(string, ... | |___[MET] AvailableAssaysChangeNotification : void() | ..... Namely, that IAssayServiceContractCallback is defined publicly in the .DLL corresponding to the .NET assembly Similarly, the Object Browser tells me that IAssayServiceContractCallback is a public interface not defined within any Class In IronPython, when I type from, IAssayServiceContractCallback is displayed in the dropdown list, but I unable to import from that symbol e.g. from IAssayServiceContractCallback import * returns Unexpected error: (, ImportError('no module named IAssayServiceContractCallback',), ) and if I try to create a class derived from IAssayServiceContractCallback class CallbackHandler(IAssayServiceContractCallback): def AvailableAssaysChangeNotification(self): pass IronPython reports: Unexpected error: (, NameError("global name 'IAssay erviceContractCallback' is not defined",), ) Is there a workaround?" ---------------------------------------------- ---------------------------------------------- You are receiving this email because you subscribed to notifications on CodePlex. To report a bug, request a feature, or add a comment, visit IronPython Issue Tracker. You can unsubscribe or change your issue notification settings on CodePlex.com. -------------- next part -------------- An HTML attachment was scrubbed... URL: From no_reply at codeplex.com Wed Nov 2 12:29:17 2011 From: no_reply at codeplex.com (no_reply at codeplex.com) Date: 2 Nov 2011 04:29:17 -0700 Subject: [Ironpython-users] IronPython, Daily Digest 11/1/2011 Message-ID: Hi ironpython, Here's your Daily Digest of new issues for project "IronPython". In today's digest:ISSUES 1. [New comment] How to access public interface in .NET DLL 2. [New comment] How to access public interface in .NET DLL 3. [New comment] How to access public interface in .NET DLL 4. [Status update] How to access public interface in .NET DLL ---------------------------------------------- ISSUES 1. [New comment] How to access public interface in .NET DLL http://ironpython.codeplex.com/workitem/31661 User slide_o_mix has commented on the issue: "You need to do something like the following: import clr clr.AddReference("XFEServiceModel") import IAssayServiceContractCallback class MyClass(ISassayServiceContractCallback): pass"----------------- 2. [New comment] How to access public interface in .NET DLL http://ironpython.codeplex.com/workitem/31661 User slide_o_mix has commented on the issue: "I forgot to say that you can't import from the interface, it is not a module. Which is why you just need to use the bare import statement."----------------- 3. [New comment] How to access public interface in .NET DLL http://ironpython.codeplex.com/workitem/31661 User hpweiss has commented on the issue: "That worked. Thank you."----------------- 4. [Status update] How to access public interface in .NET DLL http://ironpython.codeplex.com/workitem/31661 User slide_o_mix has updated the issue: Status has changed from Proposed to Closed with the following comment, "This is not a bug. Please use the IronPython mailing list for questions in the future." ---------------------------------------------- ---------------------------------------------- You are receiving this email because you subscribed to notifications on CodePlex. To report a bug, request a feature, or add a comment, visit IronPython Issue Tracker. You can unsubscribe or change your issue notification settings on CodePlex.com. -------------- next part -------------- An HTML attachment was scrubbed... URL: From dinov at microsoft.com Thu Nov 3 00:09:17 2011 From: dinov at microsoft.com (Dino Viehland) Date: Wed, 2 Nov 2011 23:09:17 +0000 Subject: [Ironpython-users] [ANN] Python Tools for Visual Studio 1.1 Alpha Message-ID: <6C7ABA8B4E309440B857D74348836F2E3F8C3AB4@TK5EX14MBXC292.redmond.corp.microsoft.com> We're pleased to announce the release of Python Tools for Visual Studio 1.1 Alpha [http://pytools.codeplex.com/releases/view/69667]. Python Tools for Visual Studio (PTVS) is an open-source plug-in for Visual Studio which supports programming with the Python programming language. This release includes new core IDE features, a couple of new sample libraries for interacting with Kinect and Excel, and many bug fixes for issues reported since the release of 1.0. For the core IDE features we've added many new features which improve the basic editing experience. This includes a feature for automatically adding imports after typing an identifier, a command for cleaning up unused imports, support for recognizing isinstance() calls and using them for providing improved completions, and using goto definition to go to members defined in the standard library. We've also made improvements to the project system so it'll behave more like the C# including proper support of linked files outside of the project directory. And we've made some improvements to our IPython REPL support including support for inline graphs and proper support for IPython's numbered prompts. Finally we've made several small improvements to the debugger including the option to step into the Python standard library while debugging, the option to not break on SystemExit exception with exit codes of zero as well as displaying the Python thread name in the threads window. Altogether this release includes over 100 features and bug fixes - a complete list of the changes is available here Another major addition to this release includes the addition of two additional sample libraries available as separate downloads: PyKinect for working with the Kinect Beta SDK and Pyvot for working with Excel spreadsheets. Once downloaded and installed, these plug-in to Visual Studio and provide project templates; they also provide built-in support for installing into one of the recognized Python interpreters via Tools->Python Tools->Samples. The PyKinect sample is a wrapper around the Kinect SDK and enables development with the Kinect SDK directly from Python. The library presents an API which is similar to the API exposed via the Kinect SDK for C# developers. The sample includes a new template for quickly getting started creating games using PyGame with PyKinect. PyKinect is licensed under a license similar to the existing Kinect SDK. PyKinect only requires a Python implementation with ctypes - currently only Python 2.7 is supported. Pyvot (pronounced Pivot) connects familiar data-exploration and visualization tools in Excel with the powerful data analysis and transformation capabilities of Python, with an emphasis on tabular data. It provides a minimal and Pythonic interface to Excel, smoothing over the pain points in using the existing Excel object model as exposed via COM. Pyvot is licensed under the same Apache license that the rest of PTVS is distributed under. Pyvot requires pywin32 and currently runs on Python 2.6 or Python 2.7. We'd like to thank all of the users who took the time to report issues and feedback for this release: 445363200, AphexSA, benpmorgan, chadbr, dgkbny, drgn, holmboe, lblanchon, mahpour, pztrick44, salerio, slideomix, somini, stakemura, sumitbasu, swift_dev, teebot, timeisaparallax, tonyandrewmeyer, xaviergrundus, and Zooba. Thanks, The Python Tools for Visual Studio Team -------------- next part -------------- An HTML attachment was scrubbed... URL: From no_reply at codeplex.com Thu Nov 3 15:45:30 2011 From: no_reply at codeplex.com (no_reply at codeplex.com) Date: 3 Nov 2011 07:45:30 -0700 Subject: [Ironpython-users] IronPython, Daily Digest 11/2/2011 Message-ID: Hi ironpython, Here's your Daily Digest of new issues for project "IronPython". In today's digest:ISSUES 1. [Status update] Wrong .net version is displayed by ipy -V 2. [Status update] Using PythonEngine in C# ---------------------------------------------- ISSUES 1. [Status update] Wrong .net version is displayed by ipy -V http://ironpython.codeplex.com/workitem/25088 User jdhardy has updated the issue: Status has changed from Active to Closed with the following comment, "Fixed at least as of 2.7.1."----------------- 2. [Status update] Using PythonEngine in C# http://ironpython.codeplex.com/workitem/22788 User jdhardy has updated the issue: Status has changed from Active to Closed with the following comment, "Not enough information." ---------------------------------------------- ---------------------------------------------- You are receiving this email because you subscribed to notifications on CodePlex. To report a bug, request a feature, or add a comment, visit IronPython Issue Tracker. You can unsubscribe or change your issue notification settings on CodePlex.com. -------------- next part -------------- An HTML attachment was scrubbed... URL: From 1989lzhh at gmail.com Fri Nov 11 12:21:01 2011 From: 1989lzhh at gmail.com (=?GB2312?B?wfXV8bqj?=) Date: Fri, 11 Nov 2011 19:21:01 +0800 Subject: [Ironpython-users] Is there a way to use xmlns to reference the class which was defined in a py file? Message-ID: Hi guys, I am trying to use ironpython with wpf to create a windows GUI program. here is the situation which I encountered: I create a class which inherit from Button, then I want to use the class from xaml , Is there a way to use xmlns to reference the class which was defined in a py file? Thanks! Regards, Liu Zhenhai -------------- next part -------------- An HTML attachment was scrubbed... URL: From no_reply at codeplex.com Fri Nov 11 17:07:11 2011 From: no_reply at codeplex.com (no_reply at codeplex.com) Date: 11 Nov 2011 08:07:11 -0800 Subject: [Ironpython-users] IronPython, Daily Digest 11/10/2011 Message-ID: Hi ironpython, Here's your Daily Digest of new issues for project "IronPython". In today's digest:ISSUES 1. [New issue] Some nodes' name changed in Visual studio Dev11 when expand the variable from IronPython code ---------------------------------------------- ISSUES 1. [New issue] Some nodes' name changed in Visual studio Dev11 when expand the variable from IronPython code http://ironpython.codeplex.com/workitem/31721 User Ziegler has proposed the issue: "1. Compile the below code with: csc /debug+ /r:Microsoft.Scripting.dll /r:IronPython.dll basic01.cs 2. And open it with: devenv /debugexe basic01.exe //basic01.cs using Microsoft.Scripting; using IronPython.Compiler; using IronPython.Hosting; class C { static void Main(string[] args) { // call PrintDynamicObject on some COM object or IDynamicObject var sr = Python.CreateEngine(); var scope = sr.GetBuiltinModule(); var x = scope.GetVariable("max"); var code = sr.CreateScriptSourceFromString(@" class x(object): class_val = 5 def some_method(self): pass a = x() a.inst_val = 3 a.Name = 'Sree'", SourceCodeKind.Statements); scope = sr.CreateScope(); code.Execute(scope); dynamic y = scope.GetVariable("a"); System.Diagnostics.Debugger.Break(); After we go to the break point, then type ?y? in the watch window, and expand its node. Actual: 1. ".class" change to "_class_" 2. ".dict" removed and embedded nodes moved out 3. The node ?.slots_and_weakref? removed. Expected: 1. The name ".class" should appear 2. ".dict" and its embedded nodes should exisit 3. ?.slots_and_weakref? should exisit Additional: 1. diff picture is attached. 2. Microsoft.Scripting.dll;IronPython.dll;Microsoft.Dynamic.dll is attached." ---------------------------------------------- ---------------------------------------------- You are receiving this email because you subscribed to notifications on CodePlex. To report a bug, request a feature, or add a comment, visit IronPython Issue Tracker. You can unsubscribe or change your issue notification settings on CodePlex.com. -------------- next part -------------- An HTML attachment was scrubbed... URL: From no_reply at codeplex.com Sat Nov 12 11:21:54 2011 From: no_reply at codeplex.com (no_reply at codeplex.com) Date: 12 Nov 2011 02:21:54 -0800 Subject: [Ironpython-users] IronPython, Daily Digest 11/11/2011 Message-ID: Hi ironpython, Here's your Daily Digest of new issues for project "IronPython". In today's digest:ISSUES 1. [Status update] Some nodes' name changed in Visual studio Dev11 when expand the variable from IronPython code ---------------------------------------------- ISSUES 1. [Status update] Some nodes' name changed in Visual studio Dev11 when expand the variable from IronPython code http://ironpython.codeplex.com/workitem/31721 User jdhardy has updated the issue: Status has changed from Proposed to Closed with the following comment, "If you're using the Visual Studio integration that comes with IronPython, it is no longer being developed. Please use Python Tools for Visual Studio (http://pytools.codeplex.com). If you're already using Python Tools for Visual Studio, you'll have to re-open this bug at http://pytools.codeplex.com. (There's no way to move them between CodePlex projects.)" ---------------------------------------------- ---------------------------------------------- You are receiving this email because you subscribed to notifications on CodePlex. To report a bug, request a feature, or add a comment, visit IronPython Issue Tracker. You can unsubscribe or change your issue notification settings on CodePlex.com. -------------- next part -------------- An HTML attachment was scrubbed... URL: From no_reply at codeplex.com Tue Nov 15 12:19:58 2011 From: no_reply at codeplex.com (no_reply at codeplex.com) Date: 15 Nov 2011 03:19:58 -0800 Subject: [Ironpython-users] IronPython, Daily Digest 11/14/2011 Message-ID: Hi ironpython, Here's your Daily Digest of new issues for project "IronPython". In today's digest:ISSUES 1. [New issue] sys.version is incomplete in user created engine, creating problems in platform.py ---------------------------------------------- ISSUES 1. [New issue] sys.version is incomplete in user created engine, creating problems in platform.py http://ironpython.codeplex.com/workitem/31736 User adal has proposed the issue: "I've hit a bug where I can't use the platform.python_implementation() function in code running under a user created Python engine, because sys.version is "2.7.1 ()" instead of "2.7.1 (IronPython 2.7.1 (2.7.0.40) on .NET 4.0.30319.239)", and the platform module can't parse that. ======================= import clr clr.AddReference("IronPython") from IronPython.Hosting import Python CODE = """ import sys import platform print "Version:", sys.version print "Implementation:", platform.python_implementation() """ engine = Python.CreateEngine() engine.Execute(CODE)" ---------------------------------------------- ---------------------------------------------- You are receiving this email because you subscribed to notifications on CodePlex. To report a bug, request a feature, or add a comment, visit IronPython Issue Tracker. You can unsubscribe or change your issue notification settings on CodePlex.com. -------------- next part -------------- An HTML attachment was scrubbed... URL: From m.schaber at 3s-software.com Tue Nov 15 17:00:20 2011 From: m.schaber at 3s-software.com (Markus Schaber) Date: Tue, 15 Nov 2011 16:00:20 +0000 Subject: [Ironpython-users] Memory Leak and Lightweight Scopes Message-ID: <727D8E16AE957149B447FE368139F2B508B2972D@SERVER10> Hi, We currently have a massive memory leak using IronPython hosted in our application (about 10-15 MB per script run). Googling brought up that using the LightweightScopes option should solve that problem. However, I was not able to find any documentation about the implications of lightweight scopes. Additionally, it seems that this option does not solve our problem, at least not fully. (I'm still researching the details.) Does anyone have any hints where to redirect my research? Best regards Markus Schaber -- ___________________________ We software Automation. 3S-Smart Software Solutions GmbH Markus Schaber | Developer Memminger Str. 151 | 87439 Kempten | Germany | Tel. +49-831-54031-0 | Fax +49-831-54031-50 Email: m.schaber at 3s-software.com | Web: http://www.3s-software.com CoDeSys internet forum: http://forum.3s-software.com Download CoDeSys sample projects: http://www.3s-software.com/index.shtml?sample_projects Managing Directors: Dipl.Inf. Dieter Hess, Dipl.Inf. Manfred Werner | Trade register: Kempten HRB 6186 | Tax ID No.: DE 167014915 From dinov at microsoft.com Tue Nov 15 23:18:19 2011 From: dinov at microsoft.com (Dino Viehland) Date: Tue, 15 Nov 2011 22:18:19 +0000 Subject: [Ironpython-users] Memory Leak and Lightweight Scopes In-Reply-To: <727D8E16AE957149B447FE368139F2B508B2972D@SERVER10> References: <727D8E16AE957149B447FE368139F2B508B2972D@SERVER10> Message-ID: <6C7ABA8B4E309440B857D74348836F2E49141A30@TK5EX14MBXC294.redmond.corp.microsoft.com> Marcus wrote: > Hi, > > We currently have a massive memory leak using IronPython hosted in our > application (about 10-15 MB per script run). > > Googling brought up that using the LightweightScopes option should solve > that problem. However, I was not able to find any documentation about the > implications of lightweight scopes. We have different modes on how we can compile the top-level code. Originally one of those modes was to generate types with static fields and generate code into the static types. That let us quickly access relevant data (it's in a static) but would make it slower to generate the code (RefEmit is slower than a dynamic method) and it also made the code uncollectible. We changed this at some point to improve startup by using a set of fields which are baked into IronPython.dll and we hand out and use via DynamicMethods instead of doing RefEmit - which makes it a little bit easier to figure out if this is the cause of your leak. To see if this is the source of your leak you could look at the following classes in the IronPython.Compiler.Ast namespace: StorageData ContextStorage00* GlobalStorage00* SiteStorage* If the fields in those classes aren't getting populated then this is not the cause of the leak. I'm actually having trouble finding the exact line of code where we make the decision on which mode to use, but passing -X:LightweightScopes should definitely still work to flip this mode off. I also think we're less aggressive about enabling it now and that in general only command line apps should see this enabled by default. Also make sure that you don't have debugging enabled as that forces to create uncollectible code too and probably overrides the light weight scopes option. > Additionally, it seems that this option does not solve our problem, at least > not fully. (I'm still researching the details.) > > Does anyone have any hints where to redirect my research? My favorite technique is to just use WinDBG + sos to dump the heap and then diff the heaps. Usually after enough runs it gets to be pretty obvious. Just download windbg, attach to the process, and do: .loadby sos clr !DumpHeap Continue execution, break, dump the heap again. From there you'll usually start to see Certain objects growing in numbers, and then you can do: !GCRoot And it'll figure out who's keeping the object alive. From m.schaber at 3s-software.com Wed Nov 16 09:42:36 2011 From: m.schaber at 3s-software.com (Markus Schaber) Date: Wed, 16 Nov 2011 08:42:36 +0000 Subject: [Ironpython-users] Memory Leak and Lightweight Scopes In-Reply-To: <6C7ABA8B4E309440B857D74348836F2E49141A30@TK5EX14MBXC294.redmond.corp.microsoft.com> References: <727D8E16AE957149B447FE368139F2B508B2972D@SERVER10> <6C7ABA8B4E309440B857D74348836F2E49141A30@TK5EX14MBXC294.redmond.corp.microsoft.com> Message-ID: <727D8E16AE957149B447FE368139F2B508B35005@SERVER10> Hi, Dino, Thanks for your vast amount of information. Von: Dino Viehland [mailto:dinov at microsoft.com] > Also make sure that you don't have debugging enabled as that forces to create uncollectible code too and probably overrides the light weight scopes option. I'll first try to check that one. The reason is that we are using settrace() unconditionally, currently. If that's the real culprit: How easy is it to remove that dependency? I'd prefer not to go the way using our own AppDomain, as we pass lots of objects between the Host and the Scripts. Thanks, Markus Schaber -- ___________________________ We software Automation. 3S-Smart Software Solutions GmbH Markus Schaber | Developer Memminger Str. 151 | 87439 Kempten | Germany | Tel. +49-831-54031-0 | Fax +49-831-54031-50 Email: m.schaber at 3s-software.com | Web: http://www.3s-software.com CoDeSys internet forum: http://forum.3s-software.com Download CoDeSys sample projects: http://www.3s-software.com/index.shtml?sample_projects Managing Directors: Dipl.Inf. Dieter Hess, Dipl.Inf. Manfred Werner | Trade register: Kempten HRB 6186 | Tax ID No.: DE 167014915 From m.schaber at 3s-software.com Wed Nov 16 10:39:48 2011 From: m.schaber at 3s-software.com (Markus Schaber) Date: Wed, 16 Nov 2011 09:39:48 +0000 Subject: [Ironpython-users] Memory Leak and Lightweight Scopes In-Reply-To: <727D8E16AE957149B447FE368139F2B508B35005@SERVER10> References: <727D8E16AE957149B447FE368139F2B508B2972D@SERVER10> <6C7ABA8B4E309440B857D74348836F2E49141A30@TK5EX14MBXC294.redmond.corp.microsoft.com> <727D8E16AE957149B447FE368139F2B508B35005@SERVER10> Message-ID: <727D8E16AE957149B447FE368139F2B508B39032@SERVER10> Hi, Dino, Von: Markus Schaber > Von: Dino Viehland [mailto:dinov at microsoft.com] >> Also make sure that you don't have debugging enabled as that forces to create uncollectible code too and probably overrides the light weight scopes option. > I'll first try to check that one. The reason is that we are using settrace() unconditionally, currently. Removing the settrace() call and all other language options except LightweightScopes actually reduces the problem by an enormous amount. I guess what's left is the generated code in the dynamic assemblies, and to get rid of that leak, we will have to use AppDomains, right? I also wanted to try the interpreted mode, but found a comment that this mode is ignored. Is that correct? Thanks, Markus Schaber -- ___________________________ We software Automation. 3S-Smart Software Solutions GmbH Markus Schaber | Developer Memminger Str. 151 | 87439 Kempten | Germany | Tel. +49-831-54031-0 | Fax +49-831-54031-50 Email: m.schaber at 3s-software.com | Web: http://www.3s-software.com CoDeSys internet forum: http://forum.3s-software.com Download CoDeSys sample projects: http://www.3s-software.com/index.shtml?sample_projects Managing Directors: Dipl.Inf. Dieter Hess, Dipl.Inf. Manfred Werner | Trade register: Kempten HRB 6186 | Tax ID No.: DE 167014915 _______________________________________________ Ironpython-users mailing list Ironpython-users at python.org http://mail.python.org/mailman/listinfo/ironpython-users Mit freundlichen Gr??en Markus Schaber -- ___________________________ We software Automation. 3S-Smart Software Solutions GmbH Markus Schaber | Entwicklung Memminger Str. 151 | 87439 Kempten | Tel. +49-831-54031-0 | Fax +49-831-54031-50 Email: m.schaber at 3s-software.com | Web: http://www.3s-software.com CoDeSys Internet-Forum: http://forum.3s-software.com Gesch?ftsf?hrer: Dipl.Inf. Dieter Hess, Dipl.Inf. Manfred Werner | Handelsregister: Kempten HRB 6186 | USt-IDNr.: DE 167014915 From m.schaber at 3s-software.com Wed Nov 16 17:06:07 2011 From: m.schaber at 3s-software.com (Markus Schaber) Date: Wed, 16 Nov 2011 16:06:07 +0000 Subject: [Ironpython-users] Memory Leak and Lightweight Scopes In-Reply-To: <727D8E16AE957149B447FE368139F2B508B39032@SERVER10> References: <727D8E16AE957149B447FE368139F2B508B2972D@SERVER10> <6C7ABA8B4E309440B857D74348836F2E49141A30@TK5EX14MBXC294.redmond.corp.microsoft.com> <727D8E16AE957149B447FE368139F2B508B35005@SERVER10> <727D8E16AE957149B447FE368139F2B508B39032@SERVER10> Message-ID: <727D8E16AE957149B447FE368139F2B508B391F8@SERVER10> Hi, Von: Markus Schaber >[Memory Leaks] I now created a smaller stand-alone testcase simulating our environment, and isolated the following cases: - using Python.SetTrace(engine, delegate) leaks about 165k per script invocation. - importing the warning module from the hosting environment leaks about 1.4 M per script run. - importing the os module from the script also leaks about 1.4M per script. - Doing both imorts also leaks about 1.4M per script(!). - Combining all three of the above leads to an OutOfMemory Exception after about 331 cycles, boiling down to a leak of ~5MB per script run! - Doing none of the above (only print) apparently creates a leak-free program. I attached the test program. For the test runs above, I compiled it for .NET 4.0 and target "x86", as our production app also runs in that environment (.NET 4.0 and 32-bit only). I'll do further investigations (like memory dumping) tomorrow. Best regards Markus Schaber -- ___________________________ We software Automation. 3S-Smart Software Solutions GmbH Markus Schaber | Developer Memminger Str. 151 | 87439 Kempten | Germany | Tel. +49-831-54031-0 | Fax +49-831-54031-50 Email: m.schaber at 3s-software.com | Web: http://www.3s-software.com CoDeSys internet forum: http://forum.3s-software.com Download CoDeSys sample projects: http://www.3s-software.com/index.shtml?sample_projects Managing Directors: Dipl.Inf. Dieter Hess, Dipl.Inf. Manfred Werner | Trade register: Kempten HRB 6186 | Tax ID No.: DE 167014915 -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: Program.cs URL: From no_reply at codeplex.com Wed Nov 16 17:09:32 2011 From: no_reply at codeplex.com (no_reply at codeplex.com) Date: 16 Nov 2011 08:09:32 -0800 Subject: [Ironpython-users] IronPython, Daily Digest 11/15/2011 Message-ID: Hi ironpython, Here's your Daily Digest of new issues for project "IronPython". In today's digest:ISSUES 1. [New issue] Misleading error message with clr.AddReferenceToFileAndPath on a UNC path ---------------------------------------------- ISSUES 1. [New issue] Misleading error message with clr.AddReferenceToFileAndPath on a UNC path http://ironpython.codeplex.com/workitem/31749 User jperraud has proposed the issue: "Trying to do something like: >>> clr.AddReferenceToFileAndPath(r'\\somename\a\b\c\d\e.dll') the IPY console reports: IOError: System.IO.IOException: file does not exist: \\somename\a\b\c\d\e.dll at IronPython.Runtime.ClrModule.AddReferenceToFileAndPath(CodeContext context, String file) in c:\src\ironlanguages\m ain\Languages\IronPython\IronPython\Runtime\ClrModule.cs:line 488 The file definitely exists. Running ipy with debug symbols, it appears that a NotSupportedException exception is silently trapped in PythonContext. The message is much more useful and accurate and should be passed to the console: System.NotSupportedException occurred Message=An attempt was made to load an assembly from a network location which would have caused the assembly to be sandboxed in previous versions of the .NET Framework. This release of the .NET Framework does not enable CAS policy by default, so this load may be dangerous. If this load is not intended to sandbox the assembly, please enable the loadFromRemoteSources switch. See http://go.microsoft.com/fwlink/?LinkId=155569 for more information. Source=mscorlib StackTrace: at System.Reflection.RuntimeAssembly.nLoadFile(String path, Evidence evidence) at System.Reflection.Assembly.LoadFile(String path) at IronPython.Runtime.PythonContext.TryLoadAssemblyFromFileWithPath(String path, Assembly& res) in c:\src\ironlanguages\main\Languages\IronPython\IronPython\Runtime\PythonContext.cs:line 1348 InnerException:" ---------------------------------------------- ---------------------------------------------- You are receiving this email because you subscribed to notifications on CodePlex. To report a bug, request a feature, or add a comment, visit IronPython Issue Tracker. You can unsubscribe or change your issue notification settings on CodePlex.com. -------------- next part -------------- An HTML attachment was scrubbed... URL: From dinov at microsoft.com Wed Nov 16 18:54:50 2011 From: dinov at microsoft.com (Dino Viehland) Date: Wed, 16 Nov 2011 17:54:50 +0000 Subject: [Ironpython-users] Memory Leak and Lightweight Scopes In-Reply-To: <727D8E16AE957149B447FE368139F2B508B39032@SERVER10> References: <727D8E16AE957149B447FE368139F2B508B2972D@SERVER10> <6C7ABA8B4E309440B857D74348836F2E49141A30@TK5EX14MBXC294.redmond.corp.microsoft.com> <727D8E16AE957149B447FE368139F2B508B35005@SERVER10> <727D8E16AE957149B447FE368139F2B508B39032@SERVER10> Message-ID: <6C7ABA8B4E309440B857D74348836F2E4916664E@TK5EX14MBXC294.redmond.corp.microsoft.com> settrace() debugging should be perfectly fine, it's only the .NET debugging which causes the memory leaks. Can you open a bug and attach the repro? The repro's simple enough, I might be able to track down the leak fairly quickly. -----Original Message----- From: ironpython-users-bounces+dinov=microsoft.com at python.org [mailto:ironpython-users-bounces+dinov=microsoft.com at python.org] On Behalf Of Markus Schaber Sent: Wednesday, November 16, 2011 1:40 AM To: Markus Schaber; ironpython-users at python.org Subject: Re: [Ironpython-users] Memory Leak and Lightweight Scopes Hi, Dino, Von: Markus Schaber > Von: Dino Viehland [mailto:dinov at microsoft.com] >> Also make sure that you don't have debugging enabled as that forces to create uncollectible code too and probably overrides the light weight scopes option. > I'll first try to check that one. The reason is that we are using settrace() unconditionally, currently. Removing the settrace() call and all other language options except LightweightScopes actually reduces the problem by an enormous amount. I guess what's left is the generated code in the dynamic assemblies, and to get rid of that leak, we will have to use AppDomains, right? I also wanted to try the interpreted mode, but found a comment that this mode is ignored. Is that correct? Thanks, Markus Schaber -- ___________________________ We software Automation. 3S-Smart Software Solutions GmbH Markus Schaber | Developer Memminger Str. 151 | 87439 Kempten | Germany | Tel. +49-831-54031-0 | Fax +49-831-54031-50 Email: m.schaber at 3s-software.com | Web: http://www.3s-software.com CoDeSys internet forum: http://forum.3s-software.com Download CoDeSys sample projects: http://www.3s-software.com/index.shtml?sample_projects Managing Directors: Dipl.Inf. Dieter Hess, Dipl.Inf. Manfred Werner | Trade register: Kempten HRB 6186 | Tax ID No.: DE 167014915 _______________________________________________ Ironpython-users mailing list Ironpython-users at python.org http://mail.python.org/mailman/listinfo/ironpython-users Mit freundlichen Gr??en Markus Schaber -- ___________________________ We software Automation. 3S-Smart Software Solutions GmbH Markus Schaber | Entwicklung Memminger Str. 151 | 87439 Kempten | Tel. +49-831-54031-0 | Fax +49-831-54031-50 Email: m.schaber at 3s-software.com | Web: http://www.3s-software.com CoDeSys Internet-Forum: http://forum.3s-software.com Gesch?ftsf?hrer: Dipl.Inf. Dieter Hess, Dipl.Inf. Manfred Werner | Handelsregister: Kempten HRB 6186 | USt-IDNr.: DE 167014915 _______________________________________________ Ironpython-users mailing list Ironpython-users at python.org http://mail.python.org/mailman/listinfo/ironpython-users From no_reply at codeplex.com Thu Nov 17 13:41:02 2011 From: no_reply at codeplex.com (no_reply at codeplex.com) Date: 17 Nov 2011 04:41:02 -0800 Subject: [Ironpython-users] IronPython, Daily Digest 11/16/2011 Message-ID: Hi ironpython, Here's your Daily Digest of new issues for project "IronPython". In today's digest:ISSUES 1. [New comment] Misleading error message with clr.AddReferenceToFileAndPath on a UNC path 2. [New issue] Memory Leak 3. [New comment] Memory Leak 4. [New comment] sys.version is incomplete in user created engine, creating problems in platform.py ---------------------------------------------- ISSUES 1. [New comment] Misleading error message with clr.AddReferenceToFileAndPath on a UNC path http://ironpython.codeplex.com/workitem/31749 User jdhardy has commented on the issue: "This is related to [workitem:31006] and [workitem:31383] as well."----------------- 2. [New issue] Memory Leak http://ironpython.codeplex.com/workitem/31764 User MarkusSchaber has proposed the issue: "IronPython seems to leak memory in some conditions. The attached test case demonstrates the following cases: - using Python.SetTrace(engine, delegate) leaks about 165k per script invocation. - importing the warning module from the hosting environment leaks about 1.4 M per script run. - importing the os module from the script also leaks about 1.4M per script. - Doing both imorts also leaks about 1.4M per script(!). - Combining all three of the above leads to an OutOfMemory Exception after about 331 cycles, boiling down to a leak of ~5MB per script run! - Doing none of the above (only print) apparently creates a leak-free program. I attached the test program. For the test runs above, I compiled it for .NET 4.0 and target "x86", as our production app also runs in that environment (.NET 4.0 and 32-bit only). Execution was on Win7 64 Bit. All windows updates installed."----------------- 3. [New comment] Memory Leak http://ironpython.codeplex.com/workitem/31764 User MarkusSchaber has commented on the issue: "The program itsself (for easyer review)"----------------- 4. [New comment] sys.version is incomplete in user created engine, creating problems in platform.py http://ironpython.codeplex.com/workitem/31736 User MarkusSchaber has commented on the issue: "Does "Python.SetHostVariables(this ScriptEngine engine, string prefix, string executable, string version)" help?" ---------------------------------------------- ---------------------------------------------- You are receiving this email because you subscribed to notifications on CodePlex. To report a bug, request a feature, or add a comment, visit IronPython Issue Tracker. You can unsubscribe or change your issue notification settings on CodePlex.com. -------------- next part -------------- An HTML attachment was scrubbed... URL: From no_reply at codeplex.com Fri Nov 18 09:50:41 2011 From: no_reply at codeplex.com (no_reply at codeplex.com) Date: 18 Nov 2011 00:50:41 -0800 Subject: [Ironpython-users] IronPython, Daily Digest 11/17/2011 Message-ID: Hi ironpython, Here's your Daily Digest of new issues for project "IronPython". In today's digest:ISSUES 1. [New comment] Memory Leak ---------------------------------------------- ISSUES 1. [New comment] Memory Leak http://ironpython.codeplex.com/workitem/31764 User MarkusSchaber has commented on the issue: "Remark: Apart from my own built IronPython libs, I also tested by running against the libraries coming with the IronPython 2.7.1 installer." ---------------------------------------------- ---------------------------------------------- You are receiving this email because you subscribed to notifications on CodePlex. To report a bug, request a feature, or add a comment, visit IronPython Issue Tracker. You can unsubscribe or change your issue notification settings on CodePlex.com. -------------- next part -------------- An HTML attachment was scrubbed... URL: From no_reply at codeplex.com Sat Nov 19 12:29:39 2011 From: no_reply at codeplex.com (no_reply at codeplex.com) Date: 19 Nov 2011 03:29:39 -0800 Subject: [Ironpython-users] IronPython, Daily Digest 11/18/2011 Message-ID: Hi ironpython, Here's your Daily Digest of new issues for project "IronPython". In today's digest:ISSUES 1. [New comment] Memory Leak 2. [New comment] Memory Leak 3. [New comment] Memory Leak 4. [New comment] Memory Leak ---------------------------------------------- ISSUES 1. [New comment] Memory Leak http://ironpython.codeplex.com/workitem/31764 User MarkusSchaber has commented on the issue: "I attached a ClrProfiler generated HeapDump after some runs."----------------- 2. [New comment] Memory Leak http://ironpython.codeplex.com/workitem/31764 User MarkusSchaber has commented on the issue: "It seems that all dynamic Assemblies are built with AssemblyBuilderAccess.Run or AssemblyBuilderAccess.RunAndSave. I'll try to change some of the AssemblyBuilderAccess.Run to AssemblyBuilderAccess.RunAndSave, and see whether that improves the situation. Found 8 usages in solution (1 item) _ctypes (1 item) _ctypes.cs (1 item) (509,114) var assembly = AppDomain.CurrentDomain.DefineDynamicAssembly(new AssemblyName(name), AssemblyBuilderAccess.Run, attributes); (1 item) Runtime (1 item) Operations (1 item) PythonOps.cs (1 item) (3655,80) public static AssemblyBuilder DefineDynamicAssembly(AssemblyName name, AssemblyBuilderAccess access) { (5 items) ComInterop (2 items) ComRuntimeHelpers.cs (2 items) (270,114) var assemblyBuilder = AppDomain.CurrentDomain.DefineDynamicAssembly(new AssemblyName("ComSnippets"), AssemblyBuilderAccess.Run); (524,110) var assembly = AppDomain.CurrentDomain.DefineDynamicAssembly(new AssemblyName(name), AssemblyBuilderAccess.Run, attributes); Debugging (1 item) DelegateHelpers.cs (1 item) (50,161) AssemblyBuilder assemblyBuilder = AppDomain.CurrentDomain.DefineDynamicAssembly(new AssemblyName("Snippets.Microsoft.Scripting.Debugging"), AssemblyBuilderAccess.Run); Generation (2 items) AssemblyGen.cs (2 items) (98,83) _myAssembly = AppDomain.CurrentDomain.DefineDynamicAssembly(name, AssemblyBuilderAccess.RunAndSave, outDir, false, attributes); (106,83) _myAssembly = AppDomain.CurrentDomain.DefineDynamicAssembly(name, AssemblyBuilderAccess.Run, attributes); (1 item) Utils (1 item) DelegateUtils.cs (1 item) (39,144) Interlocked.CompareExchange(ref _assembly, AppDomain.CurrentDomain.DefineDynamicAssembly(new AssemblyName("DynamicDelegates"), AssemblyBuilderAccess.Run), null); "----------------- 3. [New comment] Memory Leak http://ironpython.codeplex.com/workitem/31764 User MarkusSchaber has commented on the issue: "Sorry, i mean to "RunAndCollect", of course!"----------------- 4. [New comment] Memory Leak http://ironpython.codeplex.com/workitem/31764 User MarkusSchaber has commented on the issue: "It seems that the RunAndCollect does not change anything. Maybe this is related to http://ironpython.codeplex.com/workitem/20399?ProjectName=ironpython ?" ---------------------------------------------- ---------------------------------------------- You are receiving this email because you subscribed to notifications on CodePlex. To report a bug, request a feature, or add a comment, visit IronPython Issue Tracker. You can unsubscribe or change your issue notification settings on CodePlex.com. -------------- next part -------------- An HTML attachment was scrubbed... URL: From m.schaber at 3s-software.com Mon Nov 21 18:21:34 2011 From: m.schaber at 3s-software.com (Markus Schaber) Date: Mon, 21 Nov 2011 17:21:34 +0000 Subject: [Ironpython-users] Setting __name__ to __main__ Message-ID: <727D8E16AE957149B447FE368139F2B508B44944@SERVER10> Hi, I want to set the __name__ variable to "__main__" in the script I execute. However, it seems that the __name__ variable always is overridden with the filename of the executed file. The attached example program gives the output "name: test" instead of "name: __main__". Googling brought up the following issues: http://ironpython.codeplex.com/workitem/2537 - Here, they use the PythonEngine.DefaultModule API which I cannot find. Best regards Markus Schaber -- ___________________________ We software Automation. 3S-Smart Software Solutions GmbH Markus Schaber | Developer Memminger Str. 151 | 87439 Kempten | Germany | Tel. +49-831-54031-0 | Fax +49-831-54031-50 Email: m.schaber at 3s-software.com | Web: http://www.3s-software.com CoDeSys internet forum: http://forum.3s-software.com Download CoDeSys sample projects: http://www.3s-software.com/index.shtml?sample_projects Managing Directors: Dipl.Inf. Dieter Hess, Dipl.Inf. Manfred Werner | Trade register: Kempten HRB 6186 | Tax ID No.: DE 167014915 -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: Program.cs URL: From cmello at gmail.com Mon Nov 21 19:07:07 2011 From: cmello at gmail.com (Cesar Mello) Date: Mon, 21 Nov 2011 16:07:07 -0200 Subject: [Ironpython-users] Metro Profile support Message-ID: Hi, Is there support for running ironpython in Windows 8 Metro style applications? If not, will it be too difficult to implement? Just watched this Build 2011 presentationand it seems DLR was not included in the Metro profile. Thank you a lot for the attention. Best regards Mello -------------- next part -------------- An HTML attachment was scrubbed... URL: From slide.o.mix at gmail.com Mon Nov 21 19:55:33 2011 From: slide.o.mix at gmail.com (Slide) Date: Mon, 21 Nov 2011 11:55:33 -0700 Subject: [Ironpython-users] Metro Profile support In-Reply-To: References: Message-ID: On Mon, Nov 21, 2011 at 11:07 AM, Cesar Mello wrote: > Hi, > > Is there support for running ironpython in Windows 8 Metro style > applications? If not, will it be too difficult to implement? > > Just watched this Build 2011 presentationand it seems DLR was not included in the Metro profile. > > Thank you a lot for the attention. > > Best regards > Mello > > _______________________________________________ > Ironpython-users mailing list > Ironpython-users at python.org > http://mail.python.org/mailman/listinfo/ironpython-users > > I don't think anyone has really looked into this yet. The DLR need not be included in the Metro profile as you can use it as a separate component (this is how IP worked pre-4.0). Whether that works or not is unknown at this point as far as I know. If you try it out (DLR can be found here http://dlr.codeplex.com/) it would be interesting to know what does and does not work. slide -- slide-o-blog http://slide-o-blog.blogspot.com/ -------------- next part -------------- An HTML attachment was scrubbed... URL: From jdhardy at gmail.com Mon Nov 21 20:05:44 2011 From: jdhardy at gmail.com (Jeff Hardy) Date: Mon, 21 Nov 2011 11:05:44 -0800 Subject: [Ironpython-users] Metro Profile support In-Reply-To: References: Message-ID: On Mon, Nov 21, 2011 at 10:55 AM, Slide wrote: > > > On Mon, Nov 21, 2011 at 11:07 AM, Cesar Mello wrote: >> >> Hi, >> Is there support for running ironpython in Windows 8 Metro style >> applications? If not, will it be too difficult to implement? >> Just watched this Build 2011 presentation and it seems DLR was not >> included in the Metro profile. >> Thank you a lot for the attention. >> Best regards >> Mello > I don't think anyone has really looked into this yet. The DLR need not be > included in the Metro profile as you can use it as a separate component > (this is how IP worked pre-4.0). Whether that works or not is unknown at > this point as far as I know. If you try it out (DLR can be found > here?http://dlr.codeplex.com/) it would be interesting to know what does and > does not work. > slide Apparently Metro also lacks Reflection.Emit support, so that means DLR code would have to run on the interpreter.* I don't think IronPython fully supports this, but IronRuby does. Incidentally, that's also what's required to work on WP7, so there's two birds with one stone there. If anyone wants learn the ins and outs or IronPython and the DLR, this would be a fantastic place to start. I'd be more than willing to help with what I know, but Tomas and Dino are the experts there. - Jeff * The DLR contains a complete stack-based interpreter (in Microsoft.Dynamic) that can run in environments without code generation like Windows Phone and (apparently) Metro. In fact, the DLR has a lot of really cool stuff that no one ever talks about. I'm working on changing that, but it's going to take a couple more months. From jdhardy at gmail.com Mon Nov 21 20:21:13 2011 From: jdhardy at gmail.com (Jeff Hardy) Date: Mon, 21 Nov 2011 11:21:13 -0800 Subject: [Ironpython-users] Metro Profile support In-Reply-To: References: Message-ID: On Mon, Nov 21, 2011 at 10:07 AM, Cesar Mello wrote: > Hi, > Is there support for running ironpython in Windows 8 Metro style > applications? If not, will it be too difficult to implement? > Just watched this Build 2011 presentation and it seems DLR was not included > in the Metro profile. > Thank you a lot for the attention. On a second look, I see System.Dynamic in Metro: http://msdn.microsoft.com/en-us/library/windows/apps/hh454068(v=VS.85).aspx. I haven't watched the talk, but which pieces are missing? It looks like someone is going to have to just build the darn thing on Win8 and see what happens (dibs out). I'd hate for IronPython not to be able to build Metro apps in some form, but I don't have the time to see it though right now. - Jeff From slide.o.mix at gmail.com Mon Nov 21 20:28:46 2011 From: slide.o.mix at gmail.com (Slide) Date: Mon, 21 Nov 2011 12:28:46 -0700 Subject: [Ironpython-users] Metro Profile support In-Reply-To: References: Message-ID: On Mon, Nov 21, 2011 at 12:21 PM, Jeff Hardy wrote: > On Mon, Nov 21, 2011 at 10:07 AM, Cesar Mello wrote: > > Hi, > > Is there support for running ironpython in Windows 8 Metro style > > applications? If not, will it be too difficult to implement? > > Just watched this Build 2011 presentation and it seems DLR was not > included > > in the Metro profile. > > Thank you a lot for the attention. > > On a second look, I see System.Dynamic in Metro: > http://msdn.microsoft.com/en-us/library/windows/apps/hh454068(v=VS.85).aspx > . > > I haven't watched the talk, but which pieces are missing? It looks > like someone is going to have to just build the darn thing on Win8 and > see what happens (dibs out). I'd hate for IronPython not to be able to > build Metro apps in some form, but I don't have the time to see it > though right now. > > - Jeff > _______________________________________________ > Ironpython-users mailing list > Ironpython-users at python.org > http://mail.python.org/mailman/listinfo/ironpython-users > I'll see what I can do, I had a Win8 VM sitting around a while back but didn't do much with it. I'll try and cook something up. slide -- slide-o-blog http://slide-o-blog.blogspot.com/ -------------- next part -------------- An HTML attachment was scrubbed... URL: From jdhardy at gmail.com Mon Nov 21 20:37:48 2011 From: jdhardy at gmail.com (Jeff Hardy) Date: Mon, 21 Nov 2011 11:37:48 -0800 Subject: [Ironpython-users] Metro Profile support In-Reply-To: <7737799D90E55E4BB9C9F7E40D161E110E3ADD49EC@VA3DIAXVS461.RED001.local> References: <7737799D90E55E4BB9C9F7E40D161E110E3ADD49EC@VA3DIAXVS461.RED001.local> Message-ID: On Mon, Nov 21, 2011 at 11:33 AM, Keith Rome wrote: > I specifically asked during the Q&A after that session about DLR support. With the changes to the type system, they seem to really want to push away from IDMOP. I also got the impression that "dynamic" in C# 4.5 will not be quite the same (perhaps Call Sites aren't going to work?). It seems to me that if either of those changed a lot it might break quite a bit of the DLR pieces. > > Getting a straight answer on the topic was pretty difficult though; nobody with a blue badge wanted to discuss it. It was either still up in the air, or they wanted to pretend it didn't exist. The official response seemed to always fall back to "you can still do it in 'classic' non-metro desktop apps in win8 if you need to". Hooray for non-answers! Not being able to use IronPython for Metro apps is going to hurt in the future, methinks. I'll see what I can dig up. - Jeff From rome at Wintellect.com Mon Nov 21 20:33:35 2011 From: rome at Wintellect.com (Keith Rome) Date: Mon, 21 Nov 2011 11:33:35 -0800 Subject: [Ironpython-users] Metro Profile support In-Reply-To: References: Message-ID: <7737799D90E55E4BB9C9F7E40D161E110E3ADD49EC@VA3DIAXVS461.RED001.local> I specifically asked during the Q&A after that session about DLR support. With the changes to the type system, they seem to really want to push away from IDMOP. I also got the impression that "dynamic" in C# 4.5 will not be quite the same (perhaps Call Sites aren't going to work?). It seems to me that if either of those changed a lot it might break quite a bit of the DLR pieces. Getting a straight answer on the topic was pretty difficult though; nobody with a blue badge wanted to discuss it. It was either still up in the air, or they wanted to pretend it didn't exist. The official response seemed to always fall back to "you can still do it in 'classic' non-metro desktop apps in win8 if you need to". Keith Rome Senior Consultant and Architect MCPD-EAD, MCSD, MCDBA, MCTS-WPF, MCTS-TFS, MCTS-WSS Wintellect | 770.617.4016 | krome at wintellect.com www.wintellect.com -----Original Message----- From: ironpython-users-bounces+rome=wintellect.com at python.org [mailto:ironpython-users-bounces+rome=wintellect.com at python.org] On Behalf Of Jeff Hardy Sent: Monday, November 21, 2011 2:21 PM To: Cesar Mello Cc: ironpython-users at python.org Subject: Re: [Ironpython-users] Metro Profile support On Mon, Nov 21, 2011 at 10:07 AM, Cesar Mello wrote: > Hi, > Is there support for running ironpython in Windows 8 Metro style > applications? If not, will it be too difficult to implement? > Just watched this Build 2011 presentation and it seems DLR was not > included in the Metro profile. > Thank you a lot for the attention. On a second look, I see System.Dynamic in Metro: http://msdn.microsoft.com/en-us/library/windows/apps/hh454068(v=VS.85).aspx. I haven't watched the talk, but which pieces are missing? It looks like someone is going to have to just build the darn thing on Win8 and see what happens (dibs out). I'd hate for IronPython not to be able to build Metro apps in some form, but I don't have the time to see it though right now. - Jeff _______________________________________________ Ironpython-users mailing list Ironpython-users at python.org http://mail.python.org/mailman/listinfo/ironpython-users From Tomas.Matousek at microsoft.com Mon Nov 21 20:46:01 2011 From: Tomas.Matousek at microsoft.com (Tomas Matousek) Date: Mon, 21 Nov 2011 19:46:01 +0000 Subject: [Ironpython-users] Metro Profile support In-Reply-To: References: <7737799D90E55E4BB9C9F7E40D161E110E3ADD49EC@VA3DIAXVS461.RED001.local> Message-ID: <9597F4A19BFDB342B6E90963100C33082E4B1F2A@CH1PRD0302MB132.namprd03.prod.outlook.com> I'm also going to look at porting DLR and Iron* languages to Win8 in next couple of months -- to see what's blocking it if anything. Not promising anything though :) Tomas -----Original Message----- From: ironpython-users-bounces+tomas.matousek=microsoft.com at python.org [mailto:ironpython-users-bounces+tomas.matousek=microsoft.com at python.org] On Behalf Of Jeff Hardy Sent: Monday, November 21, 2011 11:38 AM To: Keith Rome Cc: ironpython-users at python.org Subject: Re: [Ironpython-users] Metro Profile support On Mon, Nov 21, 2011 at 11:33 AM, Keith Rome wrote: > I specifically asked during the Q&A after that session about DLR support. With the changes to the type system, they seem to really want to push away from IDMOP. I also got the impression that "dynamic" in C# 4.5 will not be quite the same (perhaps Call Sites aren't going to work?). It seems to me that if either of those changed a lot it might break quite a bit of the DLR pieces. > > Getting a straight answer on the topic was pretty difficult though; nobody with a blue badge wanted to discuss it. It was either still up in the air, or they wanted to pretend it didn't exist. The official response seemed to always fall back to "you can still do it in 'classic' non-metro desktop apps in win8 if you need to". Hooray for non-answers! Not being able to use IronPython for Metro apps is going to hurt in the future, methinks. I'll see what I can dig up. - Jeff _______________________________________________ Ironpython-users mailing list Ironpython-users at python.org http://mail.python.org/mailman/listinfo/ironpython-users From s.j.dower at gmail.com Mon Nov 21 21:51:55 2011 From: s.j.dower at gmail.com (Steve Dower) Date: Tue, 22 Nov 2011 07:51:55 +1100 Subject: [Ironpython-users] Metro Profile support In-Reply-To: <9597F4A19BFDB342B6E90963100C33082E4B1F2A@CH1PRD0302MB132.namprd03.prod.outlook.com> References: <7737799D90E55E4BB9C9F7E40D161E110E3ADD49EC@VA3DIAXVS461.RED001.local> <9597F4A19BFDB342B6E90963100C33082E4B1F2A@CH1PRD0302MB132.namprd03.prod.outlook.com> Message-ID: It should 'just work' for desktop apps, maybe some changes to get access to some of WinRT through the .NET projection, though there isn't much worth having unless you're a Metro app. Given IronPython runs on Mono/*nix as-is (ie. lack of PInvokes), there shouldn't be too much preventing it from being hosted in a managed Metro app, depending on exactly which .NET APIs have been removed -- there will be WinRT substitutes for these. The entry point is important to get the proper message loops running, otherwise the async APIs won't work properly. I'm not sure exactly how Metro apps deal with the GAC (I suspect they'll ignore it) but it should be possible to package IronPython releases up separately and apps can take a dependency on it (the VC runtime works like this). This still requires an executable stub in the main app, but won't need winmd files for IronPy. Building/signing a package manually is a pain, but if http://pytools.codeplex.com/workitem/531 gets enough votes we may get PTVS support (to match C#/C++/JS). On Tue, Nov 22, 2011 at 06:46, Tomas Matousek wrote: > I'm also going to look at porting DLR and Iron* languages to Win8 in next couple of months -- to see what's blocking it if anything. > Not promising anything though :) > > Tomas > > -----Original Message----- > From: ironpython-users-bounces+tomas.matousek=microsoft.com at python.org [mailto:ironpython-users-bounces+tomas.matousek=microsoft.com at python.org] On Behalf Of Jeff Hardy > Sent: Monday, November 21, 2011 11:38 AM > To: Keith Rome > Cc: ironpython-users at python.org > Subject: Re: [Ironpython-users] Metro Profile support > > On Mon, Nov 21, 2011 at 11:33 AM, Keith Rome wrote: >> I specifically asked during the Q&A after that session about DLR support. With the changes to the type system, they seem to really want to push away from IDMOP. I also got the impression that "dynamic" in C# 4.5 will not be quite the same (perhaps Call Sites aren't going to work?). It seems to me that if either of those changed a lot it might break quite a bit of the DLR pieces. >> >> Getting a straight answer on the topic was pretty difficult though; nobody with a blue badge wanted to discuss it. It was either still up in the air, or they wanted to pretend it didn't exist. The official response seemed to always fall back to "you can still do it in 'classic' non-metro desktop apps in win8 if you need to". > > Hooray for non-answers! Not being able to use IronPython for Metro apps is going to hurt in the future, methinks. I'll see what I can dig up. > > - Jeff > _______________________________________________ > Ironpython-users mailing list > Ironpython-users at python.org > http://mail.python.org/mailman/listinfo/ironpython-users > > > > > > _______________________________________________ > Ironpython-users mailing list > Ironpython-users at python.org > http://mail.python.org/mailman/listinfo/ironpython-users > From jdhardy at gmail.com Mon Nov 21 23:14:36 2011 From: jdhardy at gmail.com (Jeff Hardy) Date: Mon, 21 Nov 2011 14:14:36 -0800 Subject: [Ironpython-users] Metro Profile support In-Reply-To: References: <7737799D90E55E4BB9C9F7E40D161E110E3ADD49EC@VA3DIAXVS461.RED001.local> <9597F4A19BFDB342B6E90963100C33082E4B1F2A@CH1PRD0302MB132.namprd03.prod.outlook.com> Message-ID: On Mon, Nov 21, 2011 at 12:51 PM, Steve Dower wrote: > Given IronPython runs on Mono/*nix as-is (ie. lack of PInvokes), there > shouldn't be too much preventing it from being hosted in a managed > Metro app, depending on exactly which .NET APIs have been removed -- > there will be WinRT substitutes for these. The entry point is > important to get the proper message loops running, otherwise the async > APIs won't work properly. The big concern is the lack of Reflection.Emit support in Metro, and whether enough of the DLR is included in the Metro profile to not need it. It does mean that ctypes won't work, but I'm not sure what else without doing a deeper look. If we need a C# hosting stub, that's fine, and easy enough to provide. If you and Dino would be so kind as to bake it into PTVS, that'd be icing on the cake :). - Jeff From jdhardy at gmail.com Mon Nov 21 23:17:47 2011 From: jdhardy at gmail.com (Jeff Hardy) Date: Mon, 21 Nov 2011 14:17:47 -0800 Subject: [Ironpython-users] Metro Profile support In-Reply-To: References: <7737799D90E55E4BB9C9F7E40D161E110E3ADD49EC@VA3DIAXVS461.RED001.local> <9597F4A19BFDB342B6E90963100C33082E4B1F2A@CH1PRD0302MB132.namprd03.prod.outlook.com> Message-ID: Also, I've opened #31783 (http://ironpython.codeplex.com/workitem/31783) to track this. Feel free to vote for it. - Jeff On Mon, Nov 21, 2011 at 2:14 PM, Jeff Hardy wrote: > On Mon, Nov 21, 2011 at 12:51 PM, Steve Dower wrote: >> Given IronPython runs on Mono/*nix as-is (ie. lack of PInvokes), there >> shouldn't be too much preventing it from being hosted in a managed >> Metro app, depending on exactly which .NET APIs have been removed -- >> there will be WinRT substitutes for these. The entry point is >> important to get the proper message loops running, otherwise the async >> APIs won't work properly. > > The big concern is the lack of Reflection.Emit support in Metro, and > whether enough of the DLR is included in the Metro profile to not need > it. It does mean that ctypes won't work, but I'm not sure what else > without doing a deeper look. > > If we need a C# hosting stub, that's fine, and easy enough to provide. > If you and Dino would be so kind as to bake it into PTVS, that'd be > icing on the cake :). > > - Jeff > From dinov at microsoft.com Tue Nov 22 04:16:20 2011 From: dinov at microsoft.com (Dino Viehland) Date: Tue, 22 Nov 2011 03:16:20 +0000 Subject: [Ironpython-users] Metro Profile support In-Reply-To: References: <7737799D90E55E4BB9C9F7E40D161E110E3ADD49EC@VA3DIAXVS461.RED001.local> <9597F4A19BFDB342B6E90963100C33082E4B1F2A@CH1PRD0302MB132.namprd03.prod.outlook.com> Message-ID: <6C7ABA8B4E309440B857D74348836F2E4B53E106@TK5EX14MBXC292.redmond.corp.microsoft.com> > On Mon, Nov 21, 2011 at 12:51 PM, Steve Dower > wrote: > > Given IronPython runs on Mono/*nix as-is (ie. lack of PInvokes), there > > shouldn't be too much preventing it from being hosted in a managed > > Metro app, depending on exactly which .NET APIs have been removed -- > > there will be WinRT substitutes for these. The entry point is > > important to get the proper message loops running, otherwise the async > > APIs won't work properly. > > The big concern is the lack of Reflection.Emit support in Metro, and whether > enough of the DLR is included in the Metro profile to not need it. It does > mean that ctypes won't work, but I'm not sure what else without doing a > deeper look. > > If we need a C# hosting stub, that's fine, and easy enough to provide. > If you and Dino would be so kind as to bake it into PTVS, that'd be icing on the > cake :). There's a bunch of things we could do in PTVS to make this awesome, I think of the 1st two I think are what you're describing here: Templates for metro apps Create appx package support Designer support This would include updating to the Dev11 designer Intellisense between XAML and Python extended for Metro apps like WPF works today Metro app debugging - we'll need to do some special deploy and launch steps App store integration I'm sure there's more to be done too... Some of these are fairly trivial and we could easily do ourselves, but we'd also welcome contributions :) I'm always willing to answer questions if anyone has them about IronPython or PTVS. >From the IronPython side in addition to making the metro compatible build someone will also probably want to add a winrt module with a method that's similar to wpf.LoadComponent. I think the CLR projection should take care of all the fun composition stuff just like it does for WPF. We also might want to switch to ifdef'ing out features like ctypes based upon something like FEATURE_CTYPES instead of all the various platform #ifdef's we have like SILVERLIGHT. From cmello at gmail.com Tue Nov 22 12:46:44 2011 From: cmello at gmail.com (Cesar Mello) Date: Tue, 22 Nov 2011 09:46:44 -0200 Subject: [Ironpython-users] Metro Profile support In-Reply-To: References: <7737799D90E55E4BB9C9F7E40D161E110E3ADD49EC@VA3DIAXVS461.RED001.local> <9597F4A19BFDB342B6E90963100C33082E4B1F2A@CH1PRD0302MB132.namprd03.prod.outlook.com> Message-ID: Thank you very much for the attention guys! We plan to embed scripting in our server product, so the Metro profile is not a concern currently. I just wanted to take some feedback about possible difficulties for DLR-based languages in future refactorings of .NET, and how the ironpython community would address them. I didn't find Emit in the Developer Preview. The name of the Metro profile is ".NET Core Profile" and not just "Metro", so who knows where else that profile may be used (server hosting roles?) During the next month I'll be working on prototypes and I'll test the interpreter performance for our scenarios. And if there is enough time I'll try to play with the Metro profile also. Thank you so much. Best regards! Mello On Mon, Nov 21, 2011 at 8:14 PM, Jeff Hardy wrote: > On Mon, Nov 21, 2011 at 12:51 PM, Steve Dower wrote: > > Given IronPython runs on Mono/*nix as-is (ie. lack of PInvokes), there > > shouldn't be too much preventing it from being hosted in a managed > > Metro app, depending on exactly which .NET APIs have been removed -- > > there will be WinRT substitutes for these. The entry point is > > important to get the proper message loops running, otherwise the async > > APIs won't work properly. > > The big concern is the lack of Reflection.Emit support in Metro, and > whether enough of the DLR is included in the Metro profile to not need > it. It does mean that ctypes won't work, but I'm not sure what else > without doing a deeper look. > > If we need a C# hosting stub, that's fine, and easy enough to provide. > If you and Dino would be so kind as to bake it into PTVS, that'd be > icing on the cake :). > > - Jeff > _______________________________________________ > Ironpython-users mailing list > Ironpython-users at python.org > http://mail.python.org/mailman/listinfo/ironpython-users > -------------- next part -------------- An HTML attachment was scrubbed... URL: From no_reply at codeplex.com Tue Nov 22 15:37:54 2011 From: no_reply at codeplex.com (no_reply at codeplex.com) Date: 22 Nov 2011 06:37:54 -0800 Subject: [Ironpython-users] IronPython, Daily Digest 11/21/2011 Message-ID: Hi ironpython, Here's your Daily Digest of new issues for project "IronPython". In today's digest:ISSUES 1. [New issue] Support Windows 8 'Metro' ---------------------------------------------- ISSUES 1. [New issue] Support Windows 8 'Metro' http://ironpython.codeplex.com/workitem/31783 User jdhardy has proposed the issue: "This issue is to investigate whether IronPython can be used in the Windows 8 'Metro' environment, which does not have the full .NET framework. Notable missing pieces are Reflection.Emit and (possibly) DLR components." ---------------------------------------------- ---------------------------------------------- You are receiving this email because you subscribed to notifications on CodePlex. To report a bug, request a feature, or add a comment, visit IronPython Issue Tracker. You can unsubscribe or change your issue notification settings on CodePlex.com. -------------- next part -------------- An HTML attachment was scrubbed... URL: From no_reply at codeplex.com Wed Nov 23 10:48:36 2011 From: no_reply at codeplex.com (no_reply at codeplex.com) Date: 23 Nov 2011 01:48:36 -0800 Subject: [Ironpython-users] IronPython, Daily Digest 11/22/2011 Message-ID: Hi ironpython, Here's your Daily Digest of new issues for project "IronPython". In today's digest:ISSUES 1. [New comment] Support Windows 8 'Metro' 2. [New issue] Bug with Log() function 3. [New comment] Bug with Log() function ---------------------------------------------- ISSUES 1. [New comment] Support Windows 8 'Metro' http://ironpython.codeplex.com/workitem/31783 User chadbr has commented on the issue: "Yes, please."----------------- 2. [New issue] Bug with Log() function http://ironpython.codeplex.com/workitem/31788 User rmizrahi has proposed the issue: "Submit Log(1000,10) returns 2.9999999999999996. Should be 3. Checked other basic Log() tests such as 100 and 10000, which all worked fine. I am new to Python and just going through the tutorials, so not sure if this has been submitted before, etc. Note that I am running this testing in ipy64.exe on an RDP session to a Windows 7 64-bit Professional VM running in VMware vSphere. The machine has 2 processors at about 1.9Ghz, 4GB of RAM, and plenty of HD space (over 60GB free). Please let me know if additional information would help. Reuven rmizrahi at ramlogic.net"----------------- 3. [New comment] Bug with Log() function http://ironpython.codeplex.com/workitem/31788 User rmizrahi has commented on the issue: "Forgot... >>> sys.version '2.7.1 (IronPython 2.7.1 (2.7.0.40) on .NET 4.0.30319.239)'" ---------------------------------------------- ---------------------------------------------- You are receiving this email because you subscribed to notifications on CodePlex. To report a bug, request a feature, or add a comment, visit IronPython Issue Tracker. You can unsubscribe or change your issue notification settings on CodePlex.com. -------------- next part -------------- An HTML attachment was scrubbed... URL: From jdhardy at gmail.com Wed Nov 23 16:30:29 2011 From: jdhardy at gmail.com (Jeff Hardy) Date: Wed, 23 Nov 2011 07:30:29 -0800 Subject: [Ironpython-users] Setting __name__ to __main__ In-Reply-To: <727D8E16AE957149B447FE368139F2B508B44944@SERVER10> References: <727D8E16AE957149B447FE368139F2B508B44944@SERVER10> Message-ID: Your best bet is to look at the source to ipy.exe, which has to do the same thing. - Jeff On Mon, Nov 21, 2011 at 9:21 AM, Markus Schaber wrote: > Hi, > > I want to set the __name__ variable to "__main__" in the script I execute. However, it seems that the __name__ variable always is overridden with the filename of the executed file. > > The attached example program gives the output "name: test" instead of "name: __main__". > > Googling brought up the following issues: > > http://ironpython.codeplex.com/workitem/2537 - Here, they use the PythonEngine.DefaultModule API which I cannot find. > > > Best regards > > Markus Schaber > -- > ___________________________ > We software Automation. > > 3S-Smart Software Solutions GmbH > Markus Schaber | Developer > Memminger Str. 151 | 87439 Kempten | Germany | Tel. +49-831-54031-0 | Fax +49-831-54031-50 > > Email: m.schaber at 3s-software.com | Web: http://www.3s-software.com > CoDeSys internet forum: http://forum.3s-software.com > Download CoDeSys sample projects: http://www.3s-software.com/index.shtml?sample_projects > > Managing Directors: Dipl.Inf. Dieter Hess, Dipl.Inf. Manfred Werner | Trade register: Kempten HRB 6186 | Tax ID No.: DE 167014915 > > > _______________________________________________ > Ironpython-users mailing list > Ironpython-users at python.org > http://mail.python.org/mailman/listinfo/ironpython-users > > From dinov at microsoft.com Wed Nov 23 19:13:19 2011 From: dinov at microsoft.com (Dino Viehland) Date: Wed, 23 Nov 2011 18:13:19 +0000 Subject: [Ironpython-users] Setting __name__ to __main__ In-Reply-To: References: <727D8E16AE957149B447FE368139F2B508B44944@SERVER10>, Message-ID: <6C7ABA8B4E309440B857D74348836F2E4CBC6525@TK5EX14MBXC294.redmond.corp.microsoft.com> I think there's a ModuleOptions flag which controls it but don't remember how to flow it in off the top of my head ________________________________ From: Jeff Hardy Sent: 11/23/2011 7:31 AM To: Markus Schaber Cc: ironpython-users at python.org Subject: Re: [Ironpython-users] Setting __name__ to __main__ Your best bet is to look at the source to ipy.exe, which has to do the same thing. - Jeff On Mon, Nov 21, 2011 at 9:21 AM, Markus Schaber wrote: > Hi, > > I want to set the __name__ variable to "__main__" in the script I execute. However, it seems that the __name__ variable always is overridden with the filename of the executed file. > > The attached example program gives the output "name: test" instead of "name: __main__". > > Googling brought up the following issues: > > http://ironpython.codeplex.com/workitem/2537 - Here, they use the PythonEngine.DefaultModule API which I cannot find. > > > Best regards > > Markus Schaber > -- > ___________________________ > We software Automation. > > 3S-Smart Software Solutions GmbH > Markus Schaber | Developer > Memminger Str. 151 | 87439 Kempten | Germany | Tel. +49-831-54031-0 | Fax +49-831-54031-50 > > Email: m.schaber at 3s-software.com | Web: http://www.3s-software.com > CoDeSys internet forum: http://forum.3s-software.com > Download CoDeSys sample projects: http://www.3s-software.com/index.shtml?sample_projects > > Managing Directors: Dipl.Inf. Dieter Hess, Dipl.Inf. Manfred Werner | Trade register: Kempten HRB 6186 | Tax ID No.: DE 167014915 > > > _______________________________________________ > Ironpython-users mailing list > Ironpython-users at python.org > http://mail.python.org/mailman/listinfo/ironpython-users > > _______________________________________________ Ironpython-users mailing list Ironpython-users at python.org http://mail.python.org/mailman/listinfo/ironpython-users -------------- next part -------------- An HTML attachment was scrubbed... URL: From doug.blank at gmail.com Wed Nov 23 19:47:10 2011 From: doug.blank at gmail.com (Doug Blank) Date: Wed, 23 Nov 2011 13:47:10 -0500 Subject: [Ironpython-users] Setting __name__ to __main__ In-Reply-To: <6C7ABA8B4E309440B857D74348836F2E4CBC6525@TK5EX14MBXC294.redmond.corp.microsoft.com> References: <727D8E16AE957149B447FE368139F2B508B44944@SERVER10> <6C7ABA8B4E309440B857D74348836F2E4CBC6525@TK5EX14MBXC294.redmond.corp.microsoft.com> Message-ID: Perhaps this is what you are thinking of: PythonEngine engine = new PythonEngine(pyEngineOptions); engine.DefaultModule = engine.CreateModule("__main__", true); From: http://ironpython.codeplex.com/workitem/2537 -Doug On Wed, Nov 23, 2011 at 1:13 PM, Dino Viehland wrote: > I think there's a ModuleOptions flag which controls it but don't remember > how to flow it in off the top of my head > ________________________________ > From: Jeff Hardy > Sent: 11/23/2011 7:31 AM > To: Markus Schaber > Cc: ironpython-users at python.org > Subject: Re: [Ironpython-users] Setting __name__ to __main__ > > Your best bet is to look at the source to ipy.exe, which has to do the > same thing. > > - Jeff > > On Mon, Nov 21, 2011 at 9:21 AM, Markus Schaber > wrote: >> Hi, >> >> I want to set the __name__ variable to "__main__" in the script I execute. >> However, it seems that the __name__ variable always is overridden with the >> filename of the executed file. >> >> The attached example program gives the output "name: test" instead of >> "name: __main__". >> >> Googling brought up the following issues: >> >> http://ironpython.codeplex.com/workitem/2537 - Here, they use the >> PythonEngine.DefaultModule API which I cannot find. >> >> >> Best regards >> >> Markus Schaber >> -- >> ___________________________ >> We software Automation. >> >> 3S-Smart Software Solutions GmbH >> Markus Schaber | Developer >> Memminger Str. 151 | 87439 Kempten | Germany | Tel. +49-831-54031-0 | Fax >> +49-831-54031-50 >> >> Email: m.schaber at 3s-software.com | Web: http://www.3s-software.com >> CoDeSys internet forum: http://forum.3s-software.com >> Download CoDeSys sample projects: >> http://www.3s-software.com/index.shtml?sample_projects >> >> Managing Directors: Dipl.Inf. Dieter Hess, Dipl.Inf. Manfred Werner | >> Trade register: Kempten HRB 6186 | Tax ID No.: DE 167014915 >> >> >> _______________________________________________ >> Ironpython-users mailing list >> Ironpython-users at python.org >> http://mail.python.org/mailman/listinfo/ironpython-users >> >> > _______________________________________________ > Ironpython-users mailing list > Ironpython-users at python.org > http://mail.python.org/mailman/listinfo/ironpython-users > > > _______________________________________________ > Ironpython-users mailing list > Ironpython-users at python.org > http://mail.python.org/mailman/listinfo/ironpython-users > > From dinov at microsoft.com Wed Nov 23 21:22:02 2011 From: dinov at microsoft.com (Dino Viehland) Date: Wed, 23 Nov 2011 20:22:02 +0000 Subject: [Ironpython-users] Setting __name__ to __main__ In-Reply-To: References: <727D8E16AE957149B447FE368139F2B508B44944@SERVER10> <6C7ABA8B4E309440B857D74348836F2E4CBC6525@TK5EX14MBXC294.redmond.corp.microsoft.com>, Message-ID: <6C7ABA8B4E309440B857D74348836F2E4CBC97E7@TK5EX14MBXC294.redmond.corp.microsoft.com> That's the 1.1 way of doing it, the 2.x way is probably hanging off of PythonCompilerOptions (I'd look it up but I'm on my phone). ________________________________ From: Doug Blank Sent: 11/23/2011 10:47 AM To: Dino Viehland Cc: Jeff Hardy; Markus Schaber; ironpython-users at python.org Subject: Re: [Ironpython-users] Setting __name__ to __main__ Perhaps this is what you are thinking of: PythonEngine engine = new PythonEngine(pyEngineOptions); engine.DefaultModule = engine.CreateModule("__main__", true); From: http://ironpython.codeplex.com/workitem/2537 -Doug On Wed, Nov 23, 2011 at 1:13 PM, Dino Viehland wrote: > I think there's a ModuleOptions flag which controls it but don't remember > how to flow it in off the top of my head > ________________________________ > From: Jeff Hardy > Sent: 11/23/2011 7:31 AM > To: Markus Schaber > Cc: ironpython-users at python.org > Subject: Re: [Ironpython-users] Setting __name__ to __main__ > > Your best bet is to look at the source to ipy.exe, which has to do the > same thing. > > - Jeff > > On Mon, Nov 21, 2011 at 9:21 AM, Markus Schaber > wrote: >> Hi, >> >> I want to set the __name__ variable to "__main__" in the script I execute. >> However, it seems that the __name__ variable always is overridden with the >> filename of the executed file. >> >> The attached example program gives the output "name: test" instead of >> "name: __main__". >> >> Googling brought up the following issues: >> >> http://ironpython.codeplex.com/workitem/2537 - Here, they use the >> PythonEngine.DefaultModule API which I cannot find. >> >> >> Best regards >> >> Markus Schaber >> -- >> ___________________________ >> We software Automation. >> >> 3S-Smart Software Solutions GmbH >> Markus Schaber | Developer >> Memminger Str. 151 | 87439 Kempten | Germany | Tel. +49-831-54031-0 | Fax >> +49-831-54031-50 >> >> Email: m.schaber at 3s-software.com | Web: http://www.3s-software.com >> CoDeSys internet forum: http://forum.3s-software.com >> Download CoDeSys sample projects: >> http://www.3s-software.com/index.shtml?sample_projects >> >> Managing Directors: Dipl.Inf. Dieter Hess, Dipl.Inf. Manfred Werner | >> Trade register: Kempten HRB 6186 | Tax ID No.: DE 167014915 >> >> >> _______________________________________________ >> Ironpython-users mailing list >> Ironpython-users at python.org >> http://mail.python.org/mailman/listinfo/ironpython-users >> >> > _______________________________________________ > Ironpython-users mailing list > Ironpython-users at python.org > http://mail.python.org/mailman/listinfo/ironpython-users > > > _______________________________________________ > Ironpython-users mailing list > Ironpython-users at python.org > http://mail.python.org/mailman/listinfo/ironpython-users > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From ossi.heinonen at tut.fi Thu Nov 24 09:54:15 2011 From: ossi.heinonen at tut.fi (Ossi Heinonen) Date: Thu, 24 Nov 2011 10:54:15 +0200 Subject: [Ironpython-users] Scripting Ansys with IronPython - Unable to call values from dictionary Message-ID: <4ECE0637.5060100@tut.fi> Hi all! I have a problem with scripting the FEA software Ansys Workbench with IronPython. I need to come up with a script that gets the variable values in an optimum point that I have found using the optimization tools. I found some help for this with "VerifyCandidate" in the scripting guide in the Ansys manual and did this in the Ansys Workbench command window: IronPython 2.6.10920.0 on .NET 2.0.50727.3625 system1 = GetSystem(Name="GDO") optimization1 = system1.GetContainer(ComponentName="Optimization") optimizationModel1 = optimization1.GetModel() verifiedValues = optimizationModel1.VerifyCandidate(Index=0) print verifiedValues {'/Optimization/OutputParameter:P3': '-0.035979796200990677 [mm]', '/Optimization/InputParameter:P1': '5.5 [mm]', '/Optimization/OutputParameter:P2': '0.07417053282883164 [kg]'} Now I have a dictionary with my one design variable P1 and two responses P2 and P3 with their values at the optimum. Looking good so far. So now I only need to get my hands on the values and I'm home free. I think this should give me the value of the design variable P1: verifiedValues['/Optimization/InputParameter:P1'] KeyNotFoundException: /Optimization/InputParameter:P1 But no, I get an error saying that there is no such key. But when I list the keys, it's right there: dict.keys(verifiedValues) ['/Optimization/OutputParameter:P3', '/Optimization/OutputParameter:P2', '/Optimization/InputParameter:P1'] So this is my problem. I've tried calling it without the quotes or with double quotes and any other variation that I've come up with. If I make a new dictionary manually with the exact same keys and values copied from the screen it works just fine. But I can't get anything out of the original dictionary. Any ideas on how to get it working or what could be done to debug this? The only idea I've had is that for some reason the keys are printed incorrectly and some characters are actually missing from their names, but I might be totally off with this. Needless to say that I'm a total newbie with Python. Probably the right people to ask are other Ansys users, but I've had no luck finding one that could help me. Maybe my luck will chance with you Python gurus :) All help is greatly appreciated! Best regards Ossi Heinonen Researcher Tampere University of Technology Finland From 1989lzhh at gmail.com Thu Nov 24 12:05:36 2011 From: 1989lzhh at gmail.com (=?GB2312?B?wfXV8bqj?=) Date: Thu, 24 Nov 2011 19:05:36 +0800 Subject: [Ironpython-users] Scripting Ansys with IronPython - Unable to call values from dictionary In-Reply-To: <4ECE0637.5060100@tut.fi> References: <4ECE0637.5060100@tut.fi> Message-ID: Hi, I think you should check the type of verifiedValues like "type( verifiedValues)" then use the dir function to check the content of verifiedValues. maybe try to use new_verifiedValues=dict(verifiedValues) Hope it will help! Regards, Liu Zhenhai 2011/11/24 Ossi Heinonen > Hi all! > > I have a problem with scripting the FEA software Ansys Workbench with > IronPython. I need to come up with a script that gets the variable values > in an optimum point that I have found using the optimization tools. > > I found some help for this with "VerifyCandidate" in the scripting guide > in the Ansys manual and did this in the Ansys Workbench command window: > > IronPython 2.6.10920.0 on .NET 2.0.50727.3625 > system1 = GetSystem(Name="GDO") > optimization1 = system1.GetContainer(**ComponentName="Optimization") > optimizationModel1 = optimization1.GetModel() > verifiedValues = optimizationModel1.**VerifyCandidate(Index=0) > print verifiedValues > {'/Optimization/**OutputParameter:P3': '-0.035979796200990677 [mm]', > '/Optimization/InputParameter:**P1': '5.5 [mm]', > '/Optimization/**OutputParameter:P2': '0.07417053282883164 [kg]'} > > Now I have a dictionary with my one design variable P1 and two responses > P2 and P3 with their values at the optimum. Looking good so far. So now I > only need to get my hands on the values and I'm home free. > > I think this should give me the value of the design variable P1: > > verifiedValues['/Optimization/**InputParameter:P1'] > KeyNotFoundException: /Optimization/InputParameter:**P1 > > But no, I get an error saying that there is no such key. But when I list > the keys, it's right there: > > dict.keys(verifiedValues) > ['/Optimization/**OutputParameter:P3', > '/Optimization/**OutputParameter:P2', '/Optimization/InputParameter:** > P1'] > > So this is my problem. I've tried calling it without the quotes or with > double quotes and any other variation that I've come up with. If I make a > new dictionary manually with the exact same keys and values copied from the > screen it works just fine. But I can't get anything out of the original > dictionary. > > Any ideas on how to get it working or what could be done to debug this? > The only idea I've had is that for some reason the keys are printed > incorrectly and some characters are actually missing from their names, but > I might be totally off with this. > > Needless to say that I'm a total newbie with Python. Probably the right > people to ask are other Ansys users, but I've had no luck finding one that > could help me. Maybe my luck will chance with you Python gurus :) > > All help is greatly appreciated! > > Best regards > > Ossi Heinonen > Researcher > Tampere University of Technology > Finland > > ______________________________**_________________ > Ironpython-users mailing list > Ironpython-users at python.org > http://mail.python.org/**mailman/listinfo/ironpython-**users > -------------- next part -------------- An HTML attachment was scrubbed... URL: From ossi.heinonen at tut.fi Thu Nov 24 13:21:51 2011 From: ossi.heinonen at tut.fi (Ossi Heinonen) Date: Thu, 24 Nov 2011 14:21:51 +0200 Subject: [Ironpython-users] Scripting Ansys with IronPython - Unable to call values from dictionary In-Reply-To: References: <4ECE0637.5060100@tut.fi> Message-ID: <4ECE36DF.20008@tut.fi> Hi Liu Thanks for the reply! I did as you suggested. Here's what I got with type() type(verifiedValues) So it is a dictionary, right? Then I tried dir(verifiedValues) dir(verifiedValues) ['Add', 'Clear', 'Contains', 'ContainsKey', 'CopyTo', 'Count', 'Equals', 'GetEnumerator', 'GetHashCode', 'GetType', 'Item', 'Keys', 'MemberwiseClone', 'ReferenceEquals', 'Remove', 'ToString', 'TryGetValue', 'Values', '__add__', '__class__', '__cmp__', '__contains__', '__delattr__', '__delitem__', '__doc__', '__eq__', '__format__', '__ge__', '__getattribute__', '__getitem__', '__gt__', '__hash__', '__init__', '__iter__', '__le__', '__len__', '__lt__', '__ne__', '__new__', '__reduce__', '__reduce_ex__', '__repr__', '__setattr__', '__setitem__', '__sizeof__', '__str__', '__subclasshook__', 'clear', 'copy', 'fromkeys', 'get', 'has_key', 'items', 'iteritems', 'iterkeys', 'itervalues', 'keys', 'pop', 'popitem', 'setdefault', 'update', 'values'] This doesn't really say much to me, is it any help to you? Or should I use dir() in some other way? I tried some of those, for example dict.Contains(verifiedValues,'/Optimization/InputParameter:P1') False So I think this tells me - once again - that there is no such key in verifiedValues. I also triednew_verifiedValues=dict(verifiedValues) but got the same result new_verifiedValues=dict(verifiedValues) new_verifiedValues['/Optimization/InputParameter:P1'] KeyNotFoundException: /Optimization/InputParameter:P1 Would you have any thoughts about what I could try next? Best regards Ossi Heinonen On 24.11.2011 13:05, ??? wrote: > Hi, > I think you should check the type of verifiedValues like > "type(verifiedValues)" > then use the dir function to check the content of verifiedValues. > maybe try to use new_verifiedValues=dict(verifiedValues) > Hope it will help! > > Regards, > Liu Zhenhai > > 2011/11/24 Ossi Heinonen > > > Hi all! > > I have a problem with scripting the FEA software Ansys Workbench > with IronPython. I need to come up with a script that gets the > variable values in an optimum point that I have found using the > optimization tools. > > I found some help for this with "VerifyCandidate" in the scripting > guide in the Ansys manual and did this in the Ansys Workbench > command window: > > IronPython 2.6.10920.0 on .NET 2.0.50727.3625 > system1 = GetSystem(Name="GDO") > optimization1 = system1.GetContainer(ComponentName="Optimization") > optimizationModel1 = optimization1.GetModel() > verifiedValues = optimizationModel1.VerifyCandidate(Index=0) > print verifiedValues > {'/Optimization/OutputParameter:P3': '-0.035979796200990677 [mm]', > '/Optimization/InputParameter:P1': '5.5 [mm]', > '/Optimization/OutputParameter:P2': '0.07417053282883164 [kg]'} > > Now I have a dictionary with my one design variable P1 and two > responses P2 and P3 with their values at the optimum. Looking good > so far. So now I only need to get my hands on the values and I'm > home free. > > I think this should give me the value of the design variable P1: > > verifiedValues['/Optimization/InputParameter:P1'] > KeyNotFoundException: /Optimization/InputParameter:P1 > > But no, I get an error saying that there is no such key. But when > I list the keys, it's right there: > > dict.keys(verifiedValues) > ['/Optimization/OutputParameter:P3', > '/Optimization/OutputParameter:P2', > '/Optimization/InputParameter:P1'] > > So this is my problem. I've tried calling it without the quotes or > with double quotes and any other variation that I've come up with. > If I make a new dictionary manually with the exact same keys and > values copied from the screen it works just fine. But I can't get > anything out of the original dictionary. > > Any ideas on how to get it working or what could be done to debug > this? The only idea I've had is that for some reason the keys are > printed incorrectly and some characters are actually missing from > their names, but I might be totally off with this. > > Needless to say that I'm a total newbie with Python. Probably the > right people to ask are other Ansys users, but I've had no luck > finding one that could help me. Maybe my luck will chance with you > Python gurus :) > > All help is greatly appreciated! > > Best regards > > Ossi Heinonen > Researcher > Tampere University of Technology > Finland > > _______________________________________________ > Ironpython-users mailing list > Ironpython-users at python.org > http://mail.python.org/mailman/listinfo/ironpython-users > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From m.schaber at 3s-software.com Thu Nov 24 14:01:39 2011 From: m.schaber at 3s-software.com (Markus Schaber) Date: Thu, 24 Nov 2011 13:01:39 +0000 Subject: [Ironpython-users] Setting __name__ to __main__ In-Reply-To: <727D8E16AE957149B447FE368139F2B508B44944@SERVER10> References: <727D8E16AE957149B447FE368139F2B508B44944@SERVER10> Message-ID: <727D8E16AE957149B447FE368139F2B508B5EEFD@SERVER10> Hi, First, Sorry to all users which I mailed personally, this was not intentional. It seems that, even after several years of being forced to use it, Outlook and me are still not compatible. :-( Von: Markus Schaber > I want to set the __name__ variable to "__main__" in the script I execute. However, it seems that the __name__ variable always is overridden with the filename of the executed file. It seems I found a way to do it: ScriptEngine engine = Python.CreateEngine(); ScriptScope mainScope = engine.CreateScope(); ScriptSource scriptSource = engine.CreateScriptSourceFromFile("test.py", Encoding.Default, SourceCodeKind.File); PythonCompilerOptions pco = (PythonCompilerOptions) engine.GetCompilerOptions(mainScope); pco.ModuleName = "__main__"; pco.Module |= ModuleOptions.Initialize; CompiledCode compiled = scriptSource.Compile(pco); compiled.Execute(mainScope); Best regards Markus Schaber -- ___________________________ We software Automation. 3S-Smart Software Solutions GmbH Markus Schaber | Developer Memminger Str. 151 | 87439 Kempten | Germany | Tel. +49-831-54031-0 | Fax +49-831-54031-50 Email: m.schaber at 3s-software.com | Web: http://www.3s-software.com CoDeSys internet forum: http://forum.3s-software.com Download CoDeSys sample projects: http://www.3s-software.com/index.shtml?sample_projects Managing Directors: Dipl.Inf. Dieter Hess, Dipl.Inf. Manfred Werner | Trade register: Kempten HRB 6186 | Tax ID No.: DE 167014915 From no_reply at codeplex.com Thu Nov 24 16:53:29 2011 From: no_reply at codeplex.com (no_reply at codeplex.com) Date: 24 Nov 2011 07:53:29 -0800 Subject: [Ironpython-users] IronPython, Daily Digest 11/23/2011 Message-ID: Hi ironpython, Here's your Daily Digest of new issues for project "IronPython". In today's digest:ISSUES 1. [New comment] Bug with Log() function 2. [New issue] IronPython 2.7.1 csv pyc 3. [New comment] IronPython 2.7.1 csv pyc 4. [New comment] IronPython 2.7.1 csv pyc 5. [New comment] IronPython 2.7.1 csv pyc 6. [New comment] IronPython 2.7.1 csv pyc 7. [New comment] IronPython 2.7.1 csv pyc 8. [New comment] IronPython 2.7.1 csv pyc ---------------------------------------------- ISSUES 1. [New comment] Bug with Log() function http://ironpython.codeplex.com/workitem/31788 User MarkusSchaber has commented on the issue: "This seems to be a classic floating point precision problem: the .NET System.Math.Log() as well as cPython 2.6.6 (Linux) , cPython 2.6.5 (cygwin) and Active Python 2.7.2.5 (Win 64 Bit) return the same value. See http://en.wikipedia.org/wiki/Floating_point#Accuracy_problems and other sources on the internet for explanations and possible workarounds. "----------------- 2. [New issue] IronPython 2.7.1 csv pyc http://ironpython.codeplex.com/workitem/31800 User Elmi has proposed the issue: "When compiling with pyc an executable importing the csv module. The exception "IronPython.RunTime.Exceptions.ImportException: No module named csv" is thrown. The script works fine with ipy alone."----------------- 3. [New comment] IronPython 2.7.1 csv pyc http://ironpython.codeplex.com/workitem/31800 User slide_o_mix has commented on the issue: "Does this happen with any other standard library module?"----------------- 4. [New comment] IronPython 2.7.1 csv pyc http://ironpython.codeplex.com/workitem/31800 User Elmi has commented on the issue: "No, standard ones seems to work fine. I didn't try with ast or unicodedata. I'm guessing the newly integrated c extensions (csv, ast and unicodedate) are not part of the dlls bundled with ironpython 2.7.1 or something like that."----------------- 5. [New comment] IronPython 2.7.1 csv pyc http://ironpython.codeplex.com/workitem/31800 User slide_o_mix has commented on the issue: "csv is not a C module, _csv is. csv.py is a python module that imports _csv. Please try with something like unittest. "----------------- 6. [New comment] IronPython 2.7.1 csv pyc http://ironpython.codeplex.com/workitem/31800 User jdhardy has commented on the issue: "_csv, unicodedate, and _ast are all in IronPython.Modules.dll, so if that's available they all should be as well."----------------- 7. [New comment] IronPython 2.7.1 csv pyc http://ironpython.codeplex.com/workitem/31800 User Elmi has commented on the issue: "Ok you're right. I get it. unittest / json failed to import too. I'll investigate, I guess I missed something ... sounds like a stupid mistake."----------------- 8. [New comment] IronPython 2.7.1 csv pyc http://ironpython.codeplex.com/workitem/31800 User Elmi has commented on the issue: "I use pyc.py like this: > ipy.exe pyc.py /main:myfile.py /target:exe myfile.py Compiling produce myfile.exe and myfile.dll. I put the following dlls into the same folder: IronPython.dll IronPython.Modules.dll Microsoft.Dynamic.dll Microsoft.Scripting.dll Microsoft.Scripting.Metadata.dll Microsoft.Scripting.Debugging.dll MyCSharpLibrary.dll Basically the script.py contains only: import sys import clr clr.AddReferenceByPartialName ('MyCSharpLibrary') from MyCSharpLibrary import MyClass import csv # do stuff with it What did I miss ?" ---------------------------------------------- ---------------------------------------------- You are receiving this email because you subscribed to notifications on CodePlex. To report a bug, request a feature, or add a comment, visit IronPython Issue Tracker. You can unsubscribe or change your issue notification settings on CodePlex.com. -------------- next part -------------- An HTML attachment was scrubbed... URL: From ossi.heinonen at tut.fi Fri Nov 25 08:12:36 2011 From: ossi.heinonen at tut.fi (Ossi Heinonen) Date: Fri, 25 Nov 2011 09:12:36 +0200 Subject: [Ironpython-users] Scripting Ansys with IronPython - Unable to call values from dictionary In-Reply-To: <4ECE0637.5060100@tut.fi> References: <4ECE0637.5060100@tut.fi> Message-ID: <4ECF3FE4.9090507@tut.fi> Hi again Could it be possible to use some sort of wildcard method in this one? Like verifiedValues['*P1*'] or verifiedValues['?P1?'] Just a thought that seems intuitive, but is it doable? Best regards Ossi Heinonen On 24.11.2011 10:54, Ossi Heinonen wrote: > Hi all! > > I have a problem with scripting the FEA software Ansys Workbench with > IronPython. I need to come up with a script that gets the variable > values in an optimum point that I have found using the optimization > tools. > > I found some help for this with "VerifyCandidate" in the scripting > guide in the Ansys manual and did this in the Ansys Workbench command > window: > > IronPython 2.6.10920.0 on .NET 2.0.50727.3625 > system1 = GetSystem(Name="GDO") > optimization1 = system1.GetContainer(ComponentName="Optimization") > optimizationModel1 = optimization1.GetModel() > verifiedValues = optimizationModel1.VerifyCandidate(Index=0) > print verifiedValues > {'/Optimization/OutputParameter:P3': '-0.035979796200990677 [mm]', > '/Optimization/InputParameter:P1': '5.5 [mm]', > '/Optimization/OutputParameter:P2': '0.07417053282883164 [kg]'} > > Now I have a dictionary with my one design variable P1 and two > responses P2 and P3 with their values at the optimum. Looking good so > far. So now I only need to get my hands on the values and I'm home free. > > I think this should give me the value of the design variable P1: > > verifiedValues['/Optimization/InputParameter:P1'] > KeyNotFoundException: /Optimization/InputParameter:P1 > > But no, I get an error saying that there is no such key. But when I > list the keys, it's right there: > > dict.keys(verifiedValues) > ['/Optimization/OutputParameter:P3', > '/Optimization/OutputParameter:P2', '/Optimization/InputParameter:P1'] > > So this is my problem. I've tried calling it without the quotes or > with double quotes and any other variation that I've come up with. If > I make a new dictionary manually with the exact same keys and values > copied from the screen it works just fine. But I can't get anything > out of the original dictionary. > > Any ideas on how to get it working or what could be done to debug > this? The only idea I've had is that for some reason the keys are > printed incorrectly and some characters are actually missing from > their names, but I might be totally off with this. > > Needless to say that I'm a total newbie with Python. Probably the > right people to ask are other Ansys users, but I've had no luck > finding one that could help me. Maybe my luck will chance with you > Python gurus :) > > All help is greatly appreciated! > > Best regards > > Ossi Heinonen > Researcher > Tampere University of Technology > Finland > > _______________________________________________ > Ironpython-users mailing list > Ironpython-users at python.org > http://mail.python.org/mailman/listinfo/ironpython-users From jdhardy at gmail.com Fri Nov 25 09:30:58 2011 From: jdhardy at gmail.com (Jeff Hardy) Date: Fri, 25 Nov 2011 00:30:58 -0800 Subject: [Ironpython-users] Scripting Ansys with IronPython - Unable to call values from dictionary In-Reply-To: <4ECF3FE4.9090507@tut.fi> References: <4ECE0637.5060100@tut.fi> <4ECF3FE4.9090507@tut.fi> Message-ID: On Thu, Nov 24, 2011 at 11:12 PM, Ossi Heinonen wrote: > Hi again > > Could it be possible to use some sort of wildcard method in this one? Like > > ? ?verifiedValues['*P1*'] > > or > > ? ?verifiedValues['?P1?'] > > Just a thought that seems intuitive, but is it doable? No, that won't work with a plain Python dict (it could be made to work on a custom object, but that doesn't appear to be what you have here). Actually, you probably have a .NET dictionary (which is shown as dict, confusingly) - the question is whether it's generic or not. Can you try calling verifiedValues.GetType()? Also, is there a reason you're using 2.6? I believe 2.7 has some fixes around generics, so that may be necessary. - Jeff From ossi.heinonen at tut.fi Fri Nov 25 09:39:52 2011 From: ossi.heinonen at tut.fi (Ossi Heinonen) Date: Fri, 25 Nov 2011 10:39:52 +0200 Subject: [Ironpython-users] Scripting Ansys with IronPython - Unable to call values from dictionary In-Reply-To: References: <4ECE0637.5060100@tut.fi> <4ECF3FE4.9090507@tut.fi> Message-ID: <4ECF5458.3040003@tut.fi> On 25.11.2011 10:30, Jeff Hardy wrote: > On Thu, Nov 24, 2011 at 11:12 PM, Ossi Heinonen wrote: >> Hi again >> >> Could it be possible to use some sort of wildcard method in this one? Like >> >> verifiedValues['*P1*'] >> >> or >> >> verifiedValues['?P1?'] >> >> Just a thought that seems intuitive, but is it doable? > No, that won't work with a plain Python dict (it could be made to work > on a custom object, but that doesn't appear to be what you have here). > > Actually, you probably have a .NET dictionary (which is shown as dict, > confusingly) - the question is whether it's generic or not. Can you > try calling verifiedValues.GetType()? > > Also, is there a reason you're using 2.6? I believe 2.7 has some fixes > around generics, so that may be necessary. > > - Jeff Hi Jeff GetType gives me verifiedValues.GetType() I'm using the Ansys Workbench Command Window which seems to be running on IronPython 2.6. If you think it will be necessary to use a newer version, I'll try to check if that's possible. - Ossi From ossi.heinonen at tut.fi Fri Nov 25 10:49:14 2011 From: ossi.heinonen at tut.fi (Ossi Heinonen) Date: Fri, 25 Nov 2011 11:49:14 +0200 Subject: [Ironpython-users] Scripting Ansys with IronPython - Unable to callvalues from dictionary In-Reply-To: <6A375D8809CD5E4B86F3444358F9A64C3C956B@exchangesrv.profdoc.no> References: <4ECE0637.5060100@tut.fi> <6A375D8809CD5E4B86F3444358F9A64C3C956B@exchangesrv.profdoc.no> Message-ID: <4ECF649A.6050804@tut.fi> Hi Eyvind That gives me print verifiedValues[dict.keys(verifiedValues)[0]] 5.5 [mm] Which is pretty damn exactly what I need! Thank you very much! The only problem now is that the order of the keys seems a bit random but maybe I can find some pattern for that. Thanks again! - Ossi On 25.11.2011 11:24, Eyvind Axelsen wrote: > > Hi Ossi, > > I had some problems posting to the list, so I send to you directly: > > > What happens if you try the following? > > print verifiedValues[dict.keys(verifiedValues)[0]] > > > Eyvind. > > > > > -----Original Message----- > From: ironpython-users-bounces+eyvind.axelsen=profdoc.no at python.org on > behalf of Ossi Heinonen > Sent: Thu 24.11.2011 09:54 > To: Ironpython-users at python.org > Subject: [Ironpython-users] Scripting Ansys with IronPython - Unable > to callvalues from dictionary > > Hi all! > > I have a problem with scripting the FEA software Ansys Workbench with > IronPython. I need to come up with a script that gets the variable > values in an optimum point that I have found using the optimization tools. > > I found some help for this with "VerifyCandidate" in the scripting guide > in the Ansys manual and did this in the Ansys Workbench command window: > > IronPython 2.6.10920.0 on .NET 2.0.50727.3625 > system1 = GetSystem(Name="GDO") > optimization1 = system1.GetContainer(ComponentName="Optimization") > optimizationModel1 = optimization1.GetModel() > verifiedValues = optimizationModel1.VerifyCandidate(Index=0) > print verifiedValues > {'/Optimization/OutputParameter:P3': '-0.035979796200990677 [mm]', > '/Optimization/InputParameter:P1': '5.5 [mm]', > '/Optimization/OutputParameter:P2': '0.07417053282883164 [kg]'} > > Now I have a dictionary with my one design variable P1 and two responses > P2 and P3 with their values at the optimum. Looking good so far. So now > I only need to get my hands on the values and I'm home free. > > I think this should give me the value of the design variable P1: > > verifiedValues['/Optimization/InputParameter:P1'] > KeyNotFoundException: /Optimization/InputParameter:P1 > > But no, I get an error saying that there is no such key. But when I list > the keys, it's right there: > > dict.keys(verifiedValues) > ['/Optimization/OutputParameter:P3', > '/Optimization/OutputParameter:P2', '/Optimization/InputParameter:P1'] > > So this is my problem. I've tried calling it without the quotes or with > double quotes and any other variation that I've come up with. If I make > a new dictionary manually with the exact same keys and values copied > from the screen it works just fine. But I can't get anything out of the > original dictionary. > > Any ideas on how to get it working or what could be done to debug this? > The only idea I've had is that for some reason the keys are printed > incorrectly and some characters are actually missing from their names, > but I might be totally off with this. > > Needless to say that I'm a total newbie with Python. Probably the right > people to ask are other Ansys users, but I've had no luck finding one > that could help me. Maybe my luck will chance with you Python gurus :) > > All help is greatly appreciated! > > Best regards > > Ossi Heinonen > Researcher > Tampere University of Technology > Finland > > _______________________________________________ > Ironpython-users mailing list > Ironpython-users at python.org > http://mail.python.org/mailman/listinfo/ironpython-users > -------------- next part -------------- An HTML attachment was scrubbed... URL: From m.schaber at 3s-software.com Fri Nov 25 11:13:21 2011 From: m.schaber at 3s-software.com (Markus Schaber) Date: Fri, 25 Nov 2011 10:13:21 +0000 Subject: [Ironpython-users] Scripting Ansys with IronPython - Unable to callvalues from dictionary In-Reply-To: <4ECF649A.6050804@tut.fi> References: <4ECE0637.5060100@tut.fi> <6A375D8809CD5E4B86F3444358F9A64C3C956B@exchangesrv.profdoc.no> <4ECF649A.6050804@tut.fi> Message-ID: <727D8E16AE957149B447FE368139F2B508B611AB@SERVER10> Hi, Von: Ossi Heinonen > That gives me > > print verifiedValues[dict.keys(verifiedValues)[0]] > 5.5 [mm] > >Which is pretty damn exactly what I need! Thank you very much! The only problem now is that the order of the keys seems a bit random but maybe I can find some pattern for that. My guess is that the String for the Key is not exactly what you expect. Can you give us the output of the following command: for c in dict.keys(verifiedValues)[0]: print "%s: '%s'"%(ord(c), c) Maybe some strange characters (like zero-width space or so) will show up. And if not, you can still use the ord values to create a matching key string using chr(). Markus _______________________________________________ Ironpython-users mailing list Ironpython-users at python.org http://mail.python.org/mailman/listinfo/ironpython-users Best regards Markus Schaber -- ___________________________ We software Automation. 3S-Smart Software Solutions GmbH Markus Schaber | Developer Memminger Str. 151 | 87439 Kempten | Germany | Tel. +49-831-54031-0 | Fax +49-831-54031-50 Email: m.schaber at 3s-software.com | Web: http://www.3s-software.com CoDeSys internet forum: http://forum.3s-software.com Download CoDeSys sample projects: http://www.3s-software.com/index.shtml?sample_projects Managing Directors: Dipl.Inf. Dieter Hess, Dipl.Inf. Manfred Werner | Trade register: Kempten HRB 6186 | Tax ID No.: DE 167014915 From s.j.dower at gmail.com Fri Nov 25 11:20:09 2011 From: s.j.dower at gmail.com (Steve Dower) Date: Fri, 25 Nov 2011 21:20:09 +1100 Subject: [Ironpython-users] Scripting Ansys with IronPython - Unable to callvalues from dictionary In-Reply-To: <727D8E16AE957149B447FE368139F2B508B611AB@SERVER10> References: <4ECE0637.5060100@tut.fi> <6A375D8809CD5E4B86F3444358F9A64C3C956B@exchangesrv.profdoc.no> <4ECF649A.6050804@tut.fi> <727D8E16AE957149B447FE368139F2B508B611AB@SERVER10> Message-ID: Probably the keys aren't actually strings but repr() has been overridden. You could copy the dict with dict((repr(key), verifiedValues[key]) for key in verifiedValues) to get one like you expect (though it may add quotes around the key). Or you can print type(verifiedValues.keys()[0]) and see what you're actually dealing with. On Fri, Nov 25, 2011 at 21:13, Markus Schaber wrote: > Hi, > > Von: Ossi Heinonen >> That gives me >> >> ? ?print verifiedValues[dict.keys(verifiedValues)[0]] >> ? ?5.5 [mm] >> >>Which is pretty damn exactly what I need! Thank you very much! The only problem now is that the order of the keys seems a bit random but maybe I can find some pattern for that. > > My guess is that the String for the Key is not exactly what you expect. > > Can you give us the output of the following command: > > for c in dict.keys(verifiedValues)[0]: > ? ?print "%s: '%s'"%(ord(c), c) > > Maybe some strange characters (like zero-width space or so) will show up. > > And if not, you can still use the ord values to create a matching key string using chr(). > > Markus > > _______________________________________________ > Ironpython-users mailing list > Ironpython-users at python.org > http://mail.python.org/mailman/listinfo/ironpython-users > > Best regards > > Markus Schaber > -- > ___________________________ > We software Automation. > > 3S-Smart Software Solutions GmbH > Markus Schaber | Developer > Memminger Str. 151 | 87439 Kempten | Germany | Tel. +49-831-54031-0 | Fax +49-831-54031-50 > > Email: m.schaber at 3s-software.com | Web: http://www.3s-software.com > CoDeSys internet forum: http://forum.3s-software.com > Download CoDeSys sample projects: http://www.3s-software.com/index.shtml?sample_projects > > Managing Directors: Dipl.Inf. Dieter Hess, Dipl.Inf. Manfred Werner | Trade register: Kempten HRB 6186 | Tax ID No.: DE 167014915 > > _______________________________________________ > Ironpython-users mailing list > Ironpython-users at python.org > http://mail.python.org/mailman/listinfo/ironpython-users > From eyvind.axelsen at compugroupmedical.no Fri Nov 25 10:21:57 2011 From: eyvind.axelsen at compugroupmedical.no (Eyvind Axelsen) Date: Fri, 25 Nov 2011 10:21:57 +0100 Subject: [Ironpython-users] Scripting Ansys with IronPython - Unable to callvalues from dictionary References: <4ECE0637.5060100@tut.fi> Message-ID: <6A375D8809CD5E4B86F3444358F9A64C3C956A@exchangesrv.profdoc.no> What happens if you try the following? print verifiedValues[dict.keys(verifiedValues)[0]] Eyvind. -----Original Message----- From: ironpython-users-bounces+eyvind.axelsen=profdoc.no at python.org on behalf of Ossi Heinonen Sent: Thu 24.11.2011 09:54 To: Ironpython-users at python.org Subject: [Ironpython-users] Scripting Ansys with IronPython - Unable to callvalues from dictionary Hi all! I have a problem with scripting the FEA software Ansys Workbench with IronPython. I need to come up with a script that gets the variable values in an optimum point that I have found using the optimization tools. I found some help for this with "VerifyCandidate" in the scripting guide in the Ansys manual and did this in the Ansys Workbench command window: IronPython 2.6.10920.0 on .NET 2.0.50727.3625 system1 = GetSystem(Name="GDO") optimization1 = system1.GetContainer(ComponentName="Optimization") optimizationModel1 = optimization1.GetModel() verifiedValues = optimizationModel1.VerifyCandidate(Index=0) print verifiedValues {'/Optimization/OutputParameter:P3': '-0.035979796200990677 [mm]', '/Optimization/InputParameter:P1': '5.5 [mm]', '/Optimization/OutputParameter:P2': '0.07417053282883164 [kg]'} Now I have a dictionary with my one design variable P1 and two responses P2 and P3 with their values at the optimum. Looking good so far. So now I only need to get my hands on the values and I'm home free. I think this should give me the value of the design variable P1: verifiedValues['/Optimization/InputParameter:P1'] KeyNotFoundException: /Optimization/InputParameter:P1 But no, I get an error saying that there is no such key. But when I list the keys, it's right there: dict.keys(verifiedValues) ['/Optimization/OutputParameter:P3', '/Optimization/OutputParameter:P2', '/Optimization/InputParameter:P1'] So this is my problem. I've tried calling it without the quotes or with double quotes and any other variation that I've come up with. If I make a new dictionary manually with the exact same keys and values copied from the screen it works just fine. But I can't get anything out of the original dictionary. Any ideas on how to get it working or what could be done to debug this? The only idea I've had is that for some reason the keys are printed incorrectly and some characters are actually missing from their names, but I might be totally off with this. Needless to say that I'm a total newbie with Python. Probably the right people to ask are other Ansys users, but I've had no luck finding one that could help me. Maybe my luck will chance with you Python gurus :) All help is greatly appreciated! Best regards Ossi Heinonen Researcher Tampere University of Technology Finland _______________________________________________ Ironpython-users mailing list Ironpython-users at python.org http://mail.python.org/mailman/listinfo/ironpython-users -------------- next part -------------- An HTML attachment was scrubbed... URL: From ossi.heinonen at tut.fi Mon Nov 28 07:42:37 2011 From: ossi.heinonen at tut.fi (Ossi Heinonen) Date: Mon, 28 Nov 2011 08:42:37 +0200 Subject: [Ironpython-users] Scripting Ansys with IronPython - Unable to callvalues from dictionary In-Reply-To: References: <4ECE0637.5060100@tut.fi> <6A375D8809CD5E4B86F3444358F9A64C3C956B@exchangesrv.profdoc.no> <4ECF649A.6050804@tut.fi> <727D8E16AE957149B447FE368139F2B508B611AB@SERVER10> Message-ID: <4ED32D5D.8060002@tut.fi> Back in business. Steve, you are absolutely right! The type of the keys is something called DataReference which seems to refer to XML. But with repr() I should come up with a new dictionary with same keys - double quoted but that doesn't matter - and same values. And that should work very well for me. Thanks Steve and all of you! You have been very helpful! Best regards Ossi On 25.11.2011 12:20, Steve Dower wrote: > Probably the keys aren't actually strings but repr() has been > overridden. You could copy the dict with > dict((repr(key), verifiedValues[key]) for key in verifiedValues) > to get one like you expect (though it may add quotes around the key). > > Or you can > print type(verifiedValues.keys()[0]) > and see what you're actually dealing with. > > On Fri, Nov 25, 2011 at 21:13, Markus Schaber wrote: >> Hi, >> >> Von: Ossi Heinonen >>> That gives me >>> >>> print verifiedValues[dict.keys(verifiedValues)[0]] >>> 5.5 [mm] >>> >>> Which is pretty damn exactly what I need! Thank you very much! The only problem now is that the order of the keys seems a bit random but maybe I can find some pattern for that. >> My guess is that the String for the Key is not exactly what you expect. >> >> Can you give us the output of the following command: >> >> for c in dict.keys(verifiedValues)[0]: >> print "%s: '%s'"%(ord(c), c) >> >> Maybe some strange characters (like zero-width space or so) will show up. >> >> And if not, you can still use the ord values to create a matching key string using chr(). >> >> Markus >> >> _______________________________________________ >> Ironpython-users mailing list >> Ironpython-users at python.org >> http://mail.python.org/mailman/listinfo/ironpython-users >> >> Best regards >> >> Markus Schaber >> -- >> ___________________________ >> We software Automation. >> >> 3S-Smart Software Solutions GmbH >> Markus Schaber | Developer >> Memminger Str. 151 | 87439 Kempten | Germany | Tel. +49-831-54031-0 | Fax +49-831-54031-50 >> >> Email: m.schaber at 3s-software.com | Web: http://www.3s-software.com >> CoDeSys internet forum: http://forum.3s-software.com >> Download CoDeSys sample projects: http://www.3s-software.com/index.shtml?sample_projects >> >> Managing Directors: Dipl.Inf. Dieter Hess, Dipl.Inf. Manfred Werner | Trade register: Kempten HRB 6186 | Tax ID No.: DE 167014915 >> >> _______________________________________________ >> Ironpython-users mailing list >> Ironpython-users at python.org >> http://mail.python.org/mailman/listinfo/ironpython-users >> From m.schaber at 3s-software.com Mon Nov 28 16:02:43 2011 From: m.schaber at 3s-software.com (Markus Schaber) Date: Mon, 28 Nov 2011 15:02:43 +0000 Subject: [Ironpython-users] MethodInfo Runtime Object Message-ID: <727D8E16AE957149B447FE368139F2B508B62765@SERVER10> Hi, We have some existing C# classes using a custom event implementation which calls delegates via reflection[1]. Now, when subscribing to the event exposed by that class via IronPython, an ArgumentException is thrown: Unbehandelte Ausnahme: System.ArgumentException: MethodInfo muss ein MethodInfo-Laufzeitobjekt sein. Parametername: this bei System.Reflection.Emit.DynamicMethod.RTDynamicMethod.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture) bei System.Reflection.MethodBase.Invoke(Object obj, Object[] parameters) bei EventTest.Invoke(Object[] args) in D:\playgroundSharpDevelop\IronPythonDelegateTest\Program.cs:Zeile 98. bei ScriptExecutor.Main() in D:\playgroundSharpDevelop\IronPythonDelegateTest\Program.cs:Zeile 37. Script Finished I attached a stripped down example program demonstrating this behavior. Currently, we have a workaround of using a C# wrapper method as demonstrated in the example code, but this is cumbersome, as we need to create a C# wrapper for every exposed delegate type which uses that custom event implementation internally, and we need to call that wrapper explicitly from the script. I also want to avoid to rewrite the custom event implementation, as one of our goals is to add the scripting capability in a non-intrusive way. Now is there any way I can create a working MethodInfo object from pure IronPython? Best regards Markus Schaber [1] The main reason for this custom event implementation is that this implementation internally keeps the references to the delegate target as weak references, so that subscribing to that event alone does not prevent the object from being collected. -- ___________________________ We software Automation. 3S-Smart Software Solutions GmbH Markus Schaber | Developer Memminger Str. 151 | 87439 Kempten | Germany | Tel. +49-831-54031-0 | Fax +49-831-54031-50 Email: m.schaber at 3s-software.com | Web: http://www.3s-software.com CoDeSys internet forum: http://forum.3s-software.com Download CoDeSys sample projects: http://www.3s-software.com/index.shtml?sample_projects Managing Directors: Dipl.Inf. Dieter Hess, Dipl.Inf. Manfred Werner | Trade register: Kempten HRB 6186 | Tax ID No.: DE 167014915 From m.schaber at 3s-software.com Mon Nov 28 16:04:48 2011 From: m.schaber at 3s-software.com (Markus Schaber) Date: Mon, 28 Nov 2011 15:04:48 +0000 Subject: [Ironpython-users] MethodInfo Runtime Object Message-ID: <727D8E16AE957149B447FE368139F2B508B6278A@SERVER10> Hi, I just noticed that actually attaching the sample code might be an useful idea. :-) -----Urspr?ngliche Nachricht----- Von: Markus Schaber Hi, We have some existing C# classes using a custom event implementation which calls delegates via reflection[1]. Now, when subscribing to the event exposed by that class via IronPython, an ArgumentException is thrown: Unbehandelte Ausnahme: System.ArgumentException: MethodInfo muss ein MethodInfo-Laufzeitobjekt sein. Parametername: this bei System.Reflection.Emit.DynamicMethod.RTDynamicMethod.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture) bei System.Reflection.MethodBase.Invoke(Object obj, Object[] parameters) bei EventTest.Invoke(Object[] args) in D:\playgroundSharpDevelop\IronPythonDelegateTest\Program.cs:Zeile 98. bei ScriptExecutor.Main() in D:\playgroundSharpDevelop\IronPythonDelegateTest\Program.cs:Zeile 37. Script Finished I attached a stripped down example program demonstrating this behavior. Currently, we have a workaround of using a C# wrapper method as demonstrated in the example code, but this is cumbersome, as we need to create a C# wrapper for every exposed delegate type which uses that custom event implementation internally, and we need to call that wrapper explicitly from the script. I also want to avoid to rewrite the custom event implementation, as one of our goals is to add the scripting capability in a non-intrusive way. Now is there any way I can create a working MethodInfo object from pure IronPython? Best regards Markus Schaber [1] The main reason for this custom event implementation is that this implementation internally keeps the references to the delegate target as weak references, so that subscribing to that event alone does not prevent the object from being collected. -- ___________________________ We software Automation. 3S-Smart Software Solutions GmbH Markus Schaber | Developer Memminger Str. 151 | 87439 Kempten | Germany | Tel. +49-831-54031-0 | Fax +49-831-54031-50 Email: m.schaber at 3s-software.com | Web: http://www.3s-software.com CoDeSys internet forum: http://forum.3s-software.com Download CoDeSys sample projects: http://www.3s-software.com/index.shtml?sample_projects Managing Directors: Dipl.Inf. Dieter Hess, Dipl.Inf. Manfred Werner | Trade register: Kempten HRB 6186 | Tax ID No.: DE 167014915 -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: Program.cs URL: From no_reply at codeplex.com Wed Nov 30 16:20:41 2011 From: no_reply at codeplex.com (no_reply at codeplex.com) Date: 30 Nov 2011 07:20:41 -0800 Subject: [Ironpython-users] IronPython, Daily Digest 11/29/2011 Message-ID: Hi ironpython, Here's your Daily Digest of new issues for project "IronPython". In today's digest:ISSUES 1. [New issue] Using Scipy modules in Visual Studio 2. [Status update] Using Scipy modules in Visual Studio 3. [New issue] Line numbers are confused by \ at EOL in multiline strings ---------------------------------------------- ISSUES 1. [New issue] Using Scipy modules in Visual Studio http://ironpython.codeplex.com/workitem/31852 User z_shaheer has proposed the issue: "Hi, I am using Visual Basic in Visual Studio 2010 to work in SolidWorks. All my code is in VB and I want to use Scipy library to perform SVD calculations. I need to know what's the best way of doing it? I have been unable to find the ScipyDotNet DLL. I have the NumpyDotNet DLL. I do have all the Scipy modules, however, which I got from IronPython. I can view the Python scripts in VS. I was just wondering if I can use my existing VB code in VS and somehow call Scipy libraries to do the SVD calculations. I am a user of VB, and haven't used Scipy and Numpy before. Thanks for giving me your time. Shaheer"----------------- 2. [Status update] Using Scipy modules in Visual Studio http://ironpython.codeplex.com/workitem/31852 User slide_o_mix has updated the issue: Status has changed from Proposed to Closed with the following comment, "Please use the mailing list for questions/discussion http://mail.python.org/mailman/listinfo/ironpython-users"----------------- 3. [New issue] Line numbers are confused by \ at EOL in multiline strings http://ironpython.codeplex.com/workitem/31856 User sblom has proposed the issue: "In a file that includes a multiline string with one or more lines ending in '\', stack traces and other uses of line numbers end up miscounting. For example, in the attached script under ipy.exe 2.7.1, the resulting error output is: Traceback (most recent call last): File "LineNumbers.py", line 5, in Exception If I run it under CPython 2.7.2, I get: Traceback (most recent call last): File "LineNumbers.py", line 6, in raise Exception Exception Note that IronPython thinks the exception occurred on Line 5, whereas CPython thinks it occurred on Line 6." ---------------------------------------------- ---------------------------------------------- You are receiving this email because you subscribed to notifications on CodePlex. To report a bug, request a feature, or add a comment, visit IronPython Issue Tracker. You can unsubscribe or change your issue notification settings on CodePlex.com. -------------- next part -------------- An HTML attachment was scrubbed... URL: From cjustinmayers at gmail.com Wed Nov 30 23:03:52 2011 From: cjustinmayers at gmail.com (C. Justin Mayers) Date: Wed, 30 Nov 2011 14:03:52 -0800 Subject: [Ironpython-users] PI files for WING IDE Message-ID: I am brand new to IronPython and have only been using Python for a little while. I use the WING IDE and love it. I am trying to create PI files using the generate_pi.py script that Michael Foord modified and has a link to on his website ( http://www.voidspace.org.uk/ironpython/wing-how-to.shtml#introduction). I am working on a 64-bit machine which apparently can lead to problems but I have access to several 32-bit machines all with .NET 4.0. When I follow the instructions I am able to generate a handful of pi files but they seem incomplete. The generate_pi.py script only took 15 seconds to run and produced 331 KB of data. I was under the impression that it should run much longer and produce multiple MB of data. Anybody have any thoughts? Maybe someone has another script or is willing to send me a zipped copy of PI files that they generated. Thanks. Cheers, CJ -------------- next part -------------- An HTML attachment was scrubbed... URL: