Re: [IronPython] Using ipy to control a form
On Wed, Apr 9, 2008 at 10:15 PM, Curt Hagenlocher [EMAIL PROTECTED] wrote: On Wed, Apr 9, 2008 at 7:04 PM, Sanghyeon Seo [EMAIL PROTECTED] wrote: 2008/4/10, Greg Akins [EMAIL PROTECTED]: As I initially investigate IronPython, I assumed it would be possible to control a form from ipy If what you are trying to do is to play with WinForms from the interactive console, then you may want to study Tutorial/winforms.py carefully. (Or just use it.) I think winforms.py isn't working in IronPython 2.0 beta 1, but this is a good idea for 1.x. Thanks, both of you, for the suggestion. I'll start looking through that Tutorial -- Greg Akins Software Development Manager SSI Services http://kc.vanadium.com http://www.pghcodingdojo.org http://www.insomnia-consulting.org/monologue ___ Users mailing list Users@lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com
Re: [IronPython] Using ipy to control a form
On Wed, Apr 9, 2008 at 9:54 PM, Curt Hagenlocher [EMAIL PROTECTED] wrote: Use ipyw.exe with Application.Run(). ipyw.exe didn't seem to work? C:\Libraries\IronPython-2.0A6\Tutorial..\Bin\Debug\ipyw.exe C:\Libraries\IronPython-2.0A6\Tutorial Nothing appeared when I ran ipyw. No errors. No output. -- Greg Akins Software Development Manager SSI Services http://kc.vanadium.com http://www.pghcodingdojo.org http://www.insomnia-consulting.org/monologue ___ Users mailing list Users@lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com
Re: [IronPython] Using ipy to control a form
On Thu, Apr 10, 2008 at 7:21 AM, Greg Akins [EMAIL PROTECTED] wrote: On Wed, Apr 9, 2008 at 10:15 PM, Curt Hagenlocher [EMAIL PROTECTED] wrote: On Wed, Apr 9, 2008 at 7:04 PM, Sanghyeon Seo [EMAIL PROTECTED] wrote: If what you are trying to do is to play with WinForms from the interactive console, then you may want to study Tutorial/winforms.py carefully. (Or just use it.) I think winforms.py isn't working in IronPython 2.0 beta 1, but this is a good idea for 1.x. The tutorial didn't work correctly, but winforms.py seemed to work OK. Though I just did a simple form.Show() after executing, it so I'm not sure that it is working completely. The portion of the Tutorial that didn't work for me is listed below. However, I when I executed 'from System.Windows.Forms import Form' (instead of *) then form.Show() worked OK. from System.Windows.Forms import * form = Form() from System.Windows.Forms import * from System.Drawing import * f = Form() Traceback (most recent call last): File , line 0, in ##117 NameError: name 'Form' is not defined -- Greg Akins Software Development Manager SSI Services http://kc.vanadium.com http://www.pghcodingdojo.org http://www.insomnia-consulting.org/monologue ___ Users mailing list Users@lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com
Re: [IronPython] Using ipy to control a form
On Thu, Apr 10, 2008 at 4:32 AM, Greg Akins [EMAIL PROTECTED] wrote: On Wed, Apr 9, 2008 at 9:54 PM, Curt Hagenlocher [EMAIL PROTECTED] wrote: Use ipyw.exe with Application.Run(). Nothing appeared when I ran ipyw. No errors. No output. ipyw.exe doesn't give you an interactive console; you need to use it with a script. It's basically a way of running a Python script without a console. -- Curt Hagenlocher [EMAIL PROTECTED] ___ Users mailing list Users@lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com
Re: [IronPython] Using ipy to control a form
On Thu, Apr 10, 2008 at 7:38 AM, Curt Hagenlocher [EMAIL PROTECTED] wrote: ipyw.exe doesn't give you an interactive console; you need to use it with a script. It's basically a way of running a Python script without a console. Thanks Curt. And sorry for not reading farther to self-answer what was probably obvious. I'm trying to get little slices of time to work on this, so I'm firing off these question a little too quickly. -- Greg Akins Software Development Manager SSI Services http://kc.vanadium.com http://www.pghcodingdojo.org http://www.insomnia-consulting.org/monologue ___ Users mailing list Users@lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com
Re: [IronPython] NUnit Recipe - IronPython Cookbook - testing/Visual Studio newb
Hi, Have you updated your NUnit references? In the Solution Explorer, you can see a references item. Under this are all the references to other assemblies. If any of these have a yellow warning icon, then thats your problem. Hope this helps. Ben Blog.BenHall.me.uk On Thu, Apr 10, 2008 at 5:56 AM, Carl Trachte [EMAIL PROTECTED] wrote: Hello. I'm trying to get started testing. I am looking at this NUnit recipe (from the IronPython cookbook): http://blog.bittercoder.com/PermaLink,guid,86b0df08-9bb5-4d3b-a365-fdc7b5d57942.aspx I have downloaded the source code, but I'm stuck on the build. This may be off-topic, but I haven't used Visual Studio regularly since VB6. It is probably my ignorance of the IDE tool along with my ignorance of testing that is causing the problem. My setup: Windows XP NUnit 2.4.7 IronPython-1.1.1 Visual Studio Express 2008 for C# When I hit F6 to build I get a bunch of reference errors. The IronPython and IronMath ones I've corrected, but there are still about 11 more reference and namespace related problems (I admit that I don't know how to print them out). Can anyone point me in the right direction, even if it's just where to start with the IDE? I know from posts on this newsgroup that there is a unittest module in IronPython 2 beta. I'm just reluctant to jump in on a beta version when I'm working with production code. Correct me if this assumption is wrong. Thanks a ton for your help. Carl T. ___ Users mailing list Users@lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com ___ Users mailing list Users@lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com
Re: [IronPython] FW: IronPython Studio 1.0 for Isolated and Integrated VS Shell
finally had some time to play with it. To convert projects from VS SDK sample to IronPython Studio, you need to edit the pyproj files and replace the line near the end of the project that reads Import Project=$(MSBuildExtensionsPath)\Microsoft\IronPython\1.0\IronPython.targets / with Import Project=$(MSBuildExtensionsPath)\Microsoft\IronPython Studio\1.0\IronPython.targets / On Sun, Apr 6, 2008 at 11:37 AM, Ronnie Maor [EMAIL PROTECTED] wrote: forgot to mention that I'm using IPy 1.1.1 On Sun, Apr 6, 2008 at 11:34 AM, Ronnie Maor [EMAIL PROTECTED] wrote: two answers and some more info :-) 1) This is the first version IPy Studio version I've tried. I have VS2008 Pro, and have been working with the VS SDK sample in the experimental hive. The problem with the experimental hive is that we also have ReSharper and we couldn't get ReSharper to work in the hive or python support installed outside the hive, so we now have two IDEs. So when I saw your post on IPy Studio integrated mode, I decided to try it as a way to ditch the experimental hive. I installed using the binary integrated mode setup file (using all defaults), and then just tried to load my current solution and got the error message. I assumed that since IPy Studio was based on the sample it could just run my current solution with projects created with the sample in the experimental hive. Right now I'm guessing this is where I was wrong. 2) My python projects are class libraries, not web apps. The solution contains other projects which are C# libraries and a web app (ASP.NET in C#), but as far as I understand that shouldn't affect IPy Studio's ability to load my python project (?) I just tried creating a new solution with VS2008 + IPy Studio and creating python class libraries in it. This seems to work. Copying the files from my previous project and re-adding them to a new project also worked (although I didn't import all the files/directories yet) Copying the files + the project and trying to add the existing project failed again in the new solution with the same error. So now I have one configuration that seems to work and another that doesn't. I'll try building it the way that works and comparing the project files and hopefully will find what the difference is, and how to solve it, and post that here. However, if someone knows what the answer is already - please let me know :-) thanks Ronnie On Sun, Apr 6, 2008 at 12:12 AM, Harry Pierson [EMAIL PROTECTED] wrote: Two questions: 1. Did it work before with the previous IPy Studio? 2. Is it a web app? The URL you included related to web apps, and AFAIK IPy Studio doesn't include web app development support. Harry *From:* [EMAIL PROTECTED] [mailto: [EMAIL PROTECTED] *On Behalf Of *Ronnie Maor *Sent:* Saturday, April 05, 2008 2:35 AM *To:* Discussion of IronPython *Subject:* Re: [IronPython] FW: IronPython Studio 1.0 for Isolated and Integrated VS Shell this sounds great - integration with VS2008 will be much better than running with the experimental hive. however, after installing, my python projects failed to load, with the following error: could not find any resources appropriate for the specified culture or neutral culture... (see attached screenshot). also found this blog entry which sounds relevent: http://weblogs.asp.net/ngur/archive/2003/12/28/46219.aspx hoping this post will make it to someone who can fix the problem, or let me know how to work around it... thanks Ronnie On Tue, Apr 1, 2008 at 2:36 AM, Harry Pierson [EMAIL PROTECTED] wrote: Ken Levy from the Visual Studio extensibility team just blogged about the 1.0 new release of IronPython Studio ( http://codeplex.com/IronPythonStudio). As is pointed out below, this new version supports the integrated VS08 Shell, which means that if you already have VS08 installed, IPy Studio will just snap right into it. If you don't have VS08, you can download the VS08 shell for free (directions on the site) Harry Pierson PM, IronPython [EMAIL PROTECTED] http://devhawk.net http://blogs.msdn.com/vsxteam/archive/2008/03/31/ironpython-studio-1-0-for-isolated-and-integrated-vs-shell.aspx IronPython is now available in for both integrated and isolated VS Shell, see blog post for details. ___ Users mailing list Users@lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com ___ Users mailing list Users@lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com ___ Users mailing
Re: [IronPython] COM Late Binding in IronPython
I am not sure what the exact question is. However, I have posted the following at http://blogs.msdn.com/shrib/archive/2008/04/10/ole-automation-idispatch-support-in-ironpython.aspx to help understand what -X:PreferComDispatch does. OLE automation (IDispatch) support in IronPython IronPython 1.X supported COM interop by building on top of the COM interophttp://msdn2.microsoft.com/en-us/library/6bw51z5z(VS.80).aspx support built into the CLR. This relies on the use of interop assemblies for managed code to access COM objects. The interop assembly can be accessed in different ways: 1. clr.AddReference(interopAssembly) - This is the preferred mechanism so that the interop assembly does not have to be created multiple times. The down-side is that it complicates deployment. You have to ensurehttp://msdn2.microsoft.com/en-us/library/697w37zd(VS.80).aspx that the interop assembly exists on the machine. 2. Having IronPython automatically generate it on the fly - if you have a OLE automation object, IronPython tries to find its type library (TLB) and then to convert the TLB to an interop assembly on the fly using the TypeLibConverterhttp://msdn2.microsoft.com/en-us/library/system.runtime.interopservices.typelibconverter(VS.80).aspx class. The advantage is that this works seamlessly as long as there is a type library on the machine. The down-side is that this conversion can take a long time for large TLB files. This is how Word could be accessed. It requires the interop assembly Microsoft.Office.Interop.Word.dll to be available on the machine. c:\ipy.exe IronPython 2.0 Beta (2.0.0.1000) on .NET 2.0.50727.1433 Copyright (c) Microsoft Corporation. All rights reserved. import clr clr.AddReference(Microsoft.Office.Interop.Word) from Microsoft.Office.Interop.Word import ApplicationClass word = ApplicationClass() word.Visible = True doc = word.Documents.Add() doc.Range().Text = Hello from IronPython word.Quit() IronPython 2.0 has added support for interacting with OLE automation objects using the IDispatch interface. This completely eliminates the need for interop assemblies. This is the same mechanism that VBAhttp://msdn2.microsoft.com/en-us/isv/bb190538.aspx late-bound code and also WSHhttp://msdn2.microsoft.com/en-us/library/9bbdkx3k.aspx use to interact with OLE automation object. This feature can currently be accessed using the -X:PreferComDispatch command line option. Here is an interactive session showing access to Word. There are no interop assemblies in the picture. c:\ipyd -X:PreferComDispatch IronPython 2.0 Beta (2.0.0.1000) on .NET 2.0.50727.1433 Copyright (c) Microsoft Corporation. All rights reserved. import clr import System wordTypeLibGuid = System.Guid(00020905---C000-0046) clr.AddReferenceToTypeLibrary(wordTypeLibGuid) from Word import Application word = Application() word.Visible = True doc = word.Documents.Add() doc.Range().Text = Hello from IronPython word.Quit() The feature is not complete yet, and so is not currently (April 08) enabled by default. I cant say for sure when we will enable it by default, but its already quite stable for many real-world uses. We run all of our COM tests in both modes - using interop assemblies and using IDispatch. There are a few differences between the two cases in the minute details, but the mainline scenarios work well in both. This feature is implemented in the DLR, and so should be accessible from all DLR-based languages with little effort. Thanks, Shri Want to work on IronPython, IronRuby, F#?http://blogs.msdn.com/ironpython/archive/2008/02/25/ironpython-ironruby-and-f-openings-in-dev-test-and-pm.aspx Visit http://blogs.msdn.com/ironpython From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Davy Mitchell Sent: Wednesday, April 09, 2008 1:31 PM To: Discussion of IronPython Subject: [IronPython] Late Binding in IronPython Hi List, It seems odd posting here with my work hat on but here goes... :-) !! I've been looking at using IronPython and COM to work with some COM objects with VB6 (Project Compatibility - a *TOTAL* nightmare for interop). In VB.net we get round this with CreateObject which works well though somewhat limit. Is -X:PreferComDispatch flag intended to be an equivalent for IronPython and any other DLR languages? VBX? Thanks, Davy Mitchell -- Davy Mitchell Blog - http://www.latedecember.co.uk/sites/personal/davy/ Twitter - http://twitter.com/daftspaniel Skype - daftspaniel http://needgod.com inline: image001.gifinline: image002.gif___ Users mailing list Users@lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com