Re: [IronPython] Building IronPython on Mono, and web updates
On 24/03/2011 12:42, Doug Blank wrote: On Wed, Mar 23, 2011 at 11:05 AM, Jeff Hardyjdha...@gmail.com wrote: On Wed, Mar 23, 2011 at 7:13 AM, Doug Blankdoug.bl...@gmail.com wrote: Questions: 1) How to build a Release version rather than Debug? 2) How to set the framework to use 2.0 rather than 4.0? 1) msbuild Solutions/Dlr.sln /p:Configuration=Release 2) msbuild Solutions/Dlr.sln /p:Configuration=v2Debug (or v2Release) I assume xbuild's command line matches msbuild's. Yes, they do. I've begun to add some hopefully helpful notes re Mono to: http://ironpython.codeplex.com/ some .NET/Mono sections to: http://ironpython.codeplex.com/wikipage?title=Respository%20InstructionsreferringTitle=Home and a new page: http://ironpython.codeplex.com/wikipage?title=IronPython%20on%20Mono Please give feedback or feel free to refine. BTW, what is the relationship between the codeplex site, ironpython.net, and ironpython.info? It seems like information/files are spread across them. Can some consolidation be done? Or are there guidelines about what goes where? ironpython.info is my site and not affiliated with the official aspects of the project. I'm happy for it to be used in that way, but I think ironpython.net is a better official project site. All the best, Michael Foord However, it appears that building the v2... targets doesn't work right now, which I was kinda afraid of. I think there's a discrepancy between the Microsoft.Scripting DLR and the .NET 4 DLR. I made a note about that on the website, and hopefully Tomas can make that irrelevant soon. -Doug - Jeff ___ Users mailing list Users@lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com -- http://www.voidspace.org.uk/ May you do good and not evil May you find forgiveness for yourself and forgive others May you share freely, never taking more than you give. -- the sqlite blessing http://www.sqlite.org/different.html ___ Users mailing list Users@lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com
Re: [IronPython] IronPython 2.7.1 3.x Development
On 15/03/2011 07:18, Vernon Cole wrote: #!/usr/bin/ipy3 A shebang on the first line is the usual way of specifying which scripting engine to use on a posix system. If introspection were to be used to select between python versions, that would be the most obvious way to do it. Windows (tm) prefers to use filename extensions, which is why .pyw is used to specify a GUI program. The command shell does not open the file to see what's inside AFAIK. It was suggested in the past that .ipy might be used to specify IronPython programs. If that idea were carried to its logical end, one would use .ipy3w to specify an IronPython 3.x GUI script. That is a bit frightening. What about the idea of a semi-standard python dispatch program which lives on the search path, introspects the script, and calls the appropriate engine? Perhaps it could even manage to capture tracebacks sent to stderr when a script dies? There has been a long discussion recently on Python-dev [1] suggesting the creation of exactly such a launcher program for Python on Windows. Mark Hammond (copied) said he would implement it. Including IronPython support is a fine idea. All the best, Michael [1] http://mail.python.org/pipermail/python-dev/2011-March/108872.html -- Vernon Cole (sent from my 'droid phone) On Mar 15, 2011 3:20 AM, Markus Schaber m.scha...@3s-software.com mailto:m.scha...@3s-software.com wrote: Hi, Jeff, Von: Jeff Hardy With the 2.7 out the door, it's time to start thinking about 3.x. I've created a ipy-2.7-maint ... Your plans sound good for us. But we're just releasing a product hosting IronPython 2.6.2, as we're still bound to .NET 2.0 for some months, but our plans to upgrade to .NET 4.0 are on the way. So we are interested in smooth migration paths for our customers. Will it be possible to integrate / host both python 2.x (2.7.x) and 3.x in the same application? And is there some mechanism to auto-recognize whether a Script is python 2.x or 3.x syntax? Maybe some from __future__ import Python3 or something? If there's work needed in that area, maybe I can convince my seniors that we contribute. (I used to work a lot with Python and contribute to free projects in some of my former working places...) 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 tel:%2B49-831-54031-0 | Fax +49-831-54031-50 tel:%2B49-831-54031-50 Email: m.scha...@3s-software.com mailto:m.scha...@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 ___ Users mailing list Users@lists.ironpython.com mailto:Users@lists.ironpython.com http:/... ___ Users mailing list Users@lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com -- http://www.voidspace.org.uk/ May you do good and not evil May you find forgiveness for yourself and forgive others May you share freely, never taking more than you give. -- the sqlite blessing http://www.sqlite.org/different.html ___ Users mailing list Users@lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com
Re: [IronPython] IronPython @ PyCon 2011
I'll be there. :-) Michael On 7 March 2011 16:52, Giles Thomas giles.tho...@resolversystems.comwrote: Jonathan Hartley and I will be flying the Resolver Systems flag... On 07/03/2011 16:42, Jeff Hardy wrote: I'll be there, and so will Dino (with something very cool to show off). Anybody else? - Jeff ___ Users mailing list Users@lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com -- Giles Thomas giles.tho...@resolversystems.com +44 (0) 20 3051 2751 Dirigible: a programmable cloud spreadsheet http://projectdirigible.com/ 17a Clerkenwell Road, London EC1M 5RD, UK VAT No.: GB 893 5643 79 Registered in England and Wales as company number 5467329. Registered address: 843 Finchley Road, London NW11 8NA, UK ___ Users mailing list Users@lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com -- http://www.voidspace.org.uk/ May you do good and not evil May you find forgiveness for yourself and forgive others May you share freely, never taking more than you give. -- the sqlite blessing http://www.sqlite.org/different.html ___ Users mailing list Users@lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com
Re: [IronPython] IronPython @ PyCon 2011
On 7 March 2011 17:48, Jeff Hardy jdha...@gmail.com wrote: I'm going to try to organize an IronPython OpenSpace/BoF/sprint for Fri/Sat. Page coming soon. Just don't clash with the testing BoF! (And sign up for it, last year it was epic.) Maybe we can look at the Mac issue (sysconfig) during the sprints. All the best, Michael - Jeff On Mon, Mar 7, 2011 at 9:42 AM, Jeff Hardy jdha...@gmail.com wrote: I'll be there, and so will Dino (with something very cool to show off). Anybody else? - Jeff ___ Users mailing list Users@lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com -- http://www.voidspace.org.uk/ May you do good and not evil May you find forgiveness for yourself and forgive others May you share freely, never taking more than you give. -- the sqlite blessing http://www.sqlite.org/different.html ___ Users mailing list Users@lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com
Re: [IronPython] IronPython @ PyCon 2011
On 7 March 2011 18:27, Jeff Hardy jdha...@gmail.com wrote: On Mon, Mar 7, 2011 at 11:24 AM, Michael Foord fuzzy...@gmail.com wrote: Just don't clash with the testing BoF! (And sign up for it, last year it was epic.) I'm specifically trying to avoid that one ... it better live up to the hype :). *Nothing* ever lives up the hype. :-) Maybe we can look at the Mac issue (sysconfig) during the sprints. I won't be able to stay for the sprints, just Thu-Sun. Well, maybe we can find twenty minutes during some lunch break to chat about it. Michael - Jeff -- http://www.voidspace.org.uk/ May you do good and not evil May you find forgiveness for yourself and forgive others May you share freely, never taking more than you give. -- the sqlite blessing http://www.sqlite.org/different.html ___ Users mailing list Users@lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com
Re: [IronPython] Proposed Release Schedule for 2.7
On 28/01/2011 23:39, Jeff Hardy wrote: I'd like to propose the following release schedule for IronPython 2.7: Beta 2 - February 6 RC1 - February 20 RC2 - February 27 RTM - March 6 Looks great - thanks for driving this forward Jeff. Michael The need for a Beta 3 release could push those dates back by up to two weeks. Also, I may reevaluate based on the rate of bugs being fixed - if lots of fixes are coming in, delaying the release may be worthwhile. Obviously, any showstoppers would have an affect as while, but I don't believe there are any of those at the moment. The only current blocker for release is that the test suite does not pass 100%. That will need to be sorted prior to RTM. It's an aggressive schedule, but I think IronPython has gone too long without a release. I'm expecting there to be 2.7.x releases every 4-6 weeks if there are sufficient contributions (like new modules). I want to get the 2.x series behind us so that work can begin on 3.2/3.3. Compatibility with 3.x is going to be much better than 2.x, and with most Python stuff needing porting effort anyway getting IronPython support will be easier. That's going to require some work in the innards, and I'm not sure too many people are familiar with those parts or IronPython yet. I've already updated the version numbers to Beta 2 and fixed the installer bugs that prevented Beta 1 from installing over Alpha 1. At this point, the bugs that get fixed will probably be the ones that have patches, or at least solid repros, attached to them. If you've got a bug that you think *must* be fixed, bring it up here. Does anyone else think this is doable? - Jeff ___ Users mailing list Users@lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com -- http://www.voidspace.org.uk/ May you do good and not evil May you find forgiveness for yourself and forgive others May you share freely, never taking more than you give. -- the sqlite blessing http://www.sqlite.org/different.html ___ Users mailing list Users@lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com
Re: [IronPython] Ref to . to be omitted from sys.path. Objections?
On 23/01/2011 21:14, Jeff Hardy wrote: On Sun, Jan 23, 2011 at 12:36 PM, Daniel D.dvdotse...@gmail.com wrote: I committed the patch using '.' as the current directory; if anyone (Dino?) needs the fully resolved path ... The . (rather ) in cPy is a neat trick. It's added only in interactive (console, -c) cases and allows you to change the CWD to the dir you want and have your custom modules picked up as local wherever dir you change to from within the console. Do that all the time when deving. Setting fully-resolved path to CWD feels limiting in that context. You mean switching using os.chdir, I presume? That works under ipy using '.' (which makes sense). Is there something special about how CPython uses '' instead of '.' that ipy should by emulating? Interesting, the empty string is indeed in sys.path from the interactive interpreter (I thought it would be '.') yet: import os os.listdir('') Traceback (most recent call last): File stdin, line 1, in module OSError: [Errno 2] No such file or directory: '' All the best, Michael Foord - Jeff ___ Users mailing list Users@lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com -- http://www.voidspace.org.uk/ May you do good and not evil May you find forgiveness for yourself and forgive others May you share freely, never taking more than you give. -- the sqlite blessing http://www.sqlite.org/different.html ___ Users mailing list Users@lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com
Re: [IronPython] Issue Triage
On 16/01/2011 09:23, Richard Nienaber wrote: I've closed the following issues: test blocking: support setting field of value type when calling ctor http://ironpython.codeplex.com/workitem/24008 keyword argument is also treated as args for params array http://ironpython.codeplex.com/workitem/24000 unable to invoke delegate object with method which takes ref args http://ironpython.codeplex.com/workitem/24009 binder does not handle argument list with keyword and tuple correctly for .net methods http://ironpython.codeplex.com/workitem/24001 tracking: wrong message when calling System.Activator.CreateInstance(None) http://ironpython.codeplex.com/workitem/24007 clr.AddReference need invalidate the cached rules related to NamespaceTracker http://ironpython.codeplex.com/workitem/24012 Questions: * Incompatibility between CPy and IPy in the way REG_EXPAND_SZ works in _winreg module. http://ironpython.codeplex.com/workitem/24042 It seems to me that in this case that IronPython was doing the right thing, and CPython was doing the wrong thing. REG_EXPAND_SZ http://msdn.microsoft.com/en-us/library/ms724884%28v=vs.85%29.aspx seems to mean that environment variables should be expanded when the value is inserted into the registry. I've assumed here that even if CPython does the wrong thing, IronPython should follow the behaviour of CPython (and closed the issue). Hmmm... it is still probably worth filing an issue with CPython: http://bugs.python.org/ All the best, Michael * Code has recently been added to fix this issue: types in assemblies loaded with .AddReferenceToFileAndPath() are not importable if they reference other assemblies http://ironpython.codeplex.com/workitem/25124 Should I close this one as well or does this need to make it into a build first? * -X:PreferComDispatch I have come across quite a few issues where there are inconsistencies when IronPython is started with/without the '-X:PreferComDispatch' switch (like this one http://ironpython.codeplex.com/workitem/24013). If I look at the IronPython console help this switch is absent and attempting to run it gives me the error 'File -X:PreferComDispatch does not exist.'. Is this option no longer available/supported? If not, what should be done with these issues? Richard ___ Users mailing list Users@lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com -- http://www.voidspace.org.uk/ May you do good and not evil May you find forgiveness for yourself and forgive others May you share freely, never taking more than you give. -- the sqlite blessing http://www.sqlite.org/different.html ___ Users mailing list Users@lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com
[IronPython] PyCon 2011 - Full talk and tutorial list now available!
I'm very pleased to announce, on behalf of the PyCon 2011 Program committee, and entire PyCon 2011 volunteer staff, that the full list of PyCon 2011 talks is now public, and available! This was an especially hard year for the PyCon program committee: we had over 200 proposals for only 95 total slots, so we ended up having to reject a lot of excellent proposals. We've spent the better part of the last few months in reviews, meetings and debates selecting which talks would be in the final PyCon program. It was not and easy task - all of the proposal authors really came through in their proposals - the number of high quality proposals we had to chose from was simply staggering. That said - the program committee completed it's work yesterday morning. Acceptance and rejection letters have been sent, and you can now view the full program on the site: http://us.pycon.org/2011/schedule/lists/talks/ This obviously complements the list of tutorials also available: http://us.pycon.org/2011/schedule/lists/tutorials/ Personally, this is my second year acting as the Program Committee chair (and hence, my last) - and between the talk list, and the list of tutorials, our current keynote speaker (http://us.pycon.org/2011/home/keynotes/) and the emerging line of up poster sessions - I'm extremely proud to have been part of the process, and extremely excited about the upcoming conference. It is going to be amazing One behalf of the entire PyCon 2011 staff, I want to again thank every single talk author for their submission(s), and I look forward to seeing all of you, and them at the conference. PyCon is an amazing conference only because of the quality talks, tutorials and community we have. I'm confident this one will knock it out of the park. As a reminder: Early Bird registration (http://us.pycon.org/2011/tickets/) closes January 17th - and we have an attendance cap of 1500 total attendees (speakers are counted against this number, and guaranteed a slot) so be sure to register today! Jesse Noller PyCon 2011 ___ PyCon-organizers mailing list pycon-organiz...@python.org http://mail.python.org/mailman/listinfo/pycon-organizers ___ Users mailing list Users@lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com
Re: [IronPython] Tim Wyatt is out of the office
Can we bounce this guys emails? Michael On 28 December 2010 23:41, Tim P. Wyatt twy...@ppi.ca wrote: I will be out of the office starting 24/12/2010 and will not return until 30/12/2010. I will be reviewing my email less frequently than usual. For urgent matters please contact the Vancouver Help Desk at 1-800-661-7712 (helpd...@ppi.ca) ___ Users mailing list Users@lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com -- http://www.voidspace.org.uk/ May you do good and not evil May you find forgiveness for yourself and forgive others May you share freely, never taking more than you give. -- the sqlite blessing http://www.sqlite.org/different.html ___ Users mailing list Users@lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com
Re: [IronPython] Re turning data to a form
On 28/11/2010 18:47, robinsiebler wrote: I have 2 forms, form a has a button that launches form b. Form b has 2 textboxes and an OK button. When the OK button is clicked, I want the form to close and the data to be returned to form a. How do I do this? One way is to show the second form modally (with a call to ShowDialog I believe), this will freeze the first form until the second form exits. Another way would be to hide the first form when the second one is shown. Give the second form a reference to the first one, and in the handler functions for the accept / cancel buttons for the second form re-show the first form. All the best, Michael -- http://www.voidspace.org.uk/ READ CAREFULLY. By accepting and reading this email you agree, on behalf of your employer, to release me from all obligations and waivers arising from any and all NON-NEGOTIATED agreements, licenses, terms-of-service, shrinkwrap, clickwrap, browsewrap, confidentiality, non-disclosure, non-compete and acceptable use policies (”BOGUS AGREEMENTS”) that I have entered into with your employer, its partners, licensors, agents and assigns, in perpetuity, without prejudice to my ongoing rights and privileges. You further represent that you have the authority to release me from any BOGUS AGREEMENTS on behalf of your employer. ___ Users mailing list Users@lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com
Re: [IronPython] Re turning data to a form
On 28 November 2010 21:06, robinsiebler robinsieb...@321.net wrote: But then I still only have the data in the 2nd (child) form. How do I get it to the 1st (main) form? The close handler of the second form has to pass it to the first form - or just set them as attributes on the second form and let the first form look at the values after control has returned to it. (Presumably the first form is responsible for showing the second form, so it already has a reference to it.) All the best, Michael Michael Foord-3 wrote: On 28/11/2010 18:47, robinsiebler wrote: I have 2 forms, form a has a button that launches form b. Form b has 2 textboxes and an OK button. When the OK button is clicked, I want the form to close and the data to be returned to form a. How do I do this? One way is to show the second form modally (with a call to ShowDialog I believe), this will freeze the first form until the second form exits. Another way would be to hide the first form when the second one is shown. Give the second form a reference to the first one, and in the handler functions for the accept / cancel buttons for the second form re-show the first form. All the best, Michael -- http://www.voidspace.org.uk/ READ CAREFULLY. By accepting and reading this email you agree, on behalf of your employer, to release me from all obligations and waivers arising from any and all NON-NEGOTIATED agreements, licenses, terms-of-service, shrinkwrap, clickwrap, browsewrap, confidentiality, non-disclosure, non-compete and acceptable use policies (”BOGUS AGREEMENTS”) that I have entered into with your employer, its partners, licensors, agents and assigns, in perpetuity, without prejudice to my ongoing rights and privileges. You further represent that you have the authority to release me from any BOGUS AGREEMENTS on behalf of your employer. ___ Users mailing list Users@lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com -- View this message in context: http://old.nabble.com/Returning-data-to-a-form-tp30325039p30325848.html Sent from the IronPython mailing list archive at Nabble.com. ___ Users mailing list Users@lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com -- http://www.voidspace.org.uk ___ Users mailing list Users@lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com
Re: [IronPython] bytes and str in 2.7 io module
On 08/11/2010 19:44, Dino Viehland wrote: Jeff wrote: On Mon, Nov 8, 2010 at 10:55 AM, Dino Viehlanddi...@microsoft.com wrote: Ahh, yeah, we should probably have a helper method in here which will convert the string back to bytes rather than all of these casts to Bytes. It could also be incompatible w/ CPython in that they *might* allow bytearray objects to be returned too which these casts would also prevent. I'll check what CPython allows (I presume you're still prohibited from looking at the source for it?). I have a patch that checks for strings as well, but I'm not happy with it yet. I think the answer is yes, we are still prohibited from looking at the code, just because we're generally not supposed to look at open source code at all. Ha. :-) Does that mean you're no longer permitted to read the IronPython source code. ;-) Michael ___ Users mailing list Users@lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com -- http://www.voidspace.org.uk/ READ CAREFULLY. By accepting and reading this email you agree, on behalf of your employer, to release me from all obligations and waivers arising from any and all NON-NEGOTIATED agreements, licenses, terms-of-service, shrinkwrap, clickwrap, browsewrap, confidentiality, non-disclosure, non-compete and acceptable use policies (”BOGUS AGREEMENTS”) that I have entered into with your employer, its partners, licensors, agents and assigns, in perpetuity, without prejudice to my ongoing rights and privileges. You further represent that you have the authority to release me from any BOGUS AGREEMENTS on behalf of your employer. ___ Users mailing list Users@lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com
Re: [IronPython] Congratulations to Michael Foord on Receiving the Community Service Award
On 04/11/2010 12:51, Pablo Dalmazzo wrote: Congratulations! Write another book! :) Thanks all. :-) I'll add writing another book to my list of things to do... Michael From: jcao...@gmail.com Date: Wed, 3 Nov 2010 23:32:34 -0500 To: users@lists.ironpython.com Subject: [IronPython] Congratulations to Michael Foord on Receiving the Community Service Award The Python Software Foundation has presented the Community Service Award for the third quarter of 2010 to Michael Foord http://www.voidspace.org.uk/python/weblog/index.shtml in recognition of his incredible work in promoting Python everywhere he could. Michael is active on IRC channels, mailing lists, conferences, sprints and similar events. On the development side, he has been doing incredible work on unitest and unitest2. Michael also helps maintain the Planet Python RSS feed and python.org http://python.org website, and with organizing the Europython meeting and Summit http://www.europython.eu/. The Python Software Foundation is pleased to recognize Michael's contributions to the community. http://pyfound.blogspot.com/2010/11/third-quarter-community-service-awards.html Well deserved! Thanks for all the hard work, Michael. ___ 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 -- http://www.voidspace.org.uk/ READ CAREFULLY. By accepting and reading this email you agree, on behalf of your employer, to release me from all obligations and waivers arising from any and all NON-NEGOTIATED agreements, licenses, terms-of-service, shrinkwrap, clickwrap, browsewrap, confidentiality, non-disclosure, non-compete and acceptable use policies (BOGUS AGREEMENTS) that I have entered into with your employer, its partners, licensors, agents and assigns, in perpetuity, without prejudice to my ongoing rights and privileges. You further represent that you have the authority to release me from any BOGUS AGREEMENTS on behalf of your employer. ___ Users mailing list Users@lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com
Re: [IronPython] The elephant in the room: source control for IronPython
On 29/10/2010 19:46, Steve Dower wrote: Are IronPython and the DLR so closely coupled that you *need* the source for both to work on it? Or can you simply develop/test IronPython using the DLR in the GAC? In general (I believe) the DLR is an integral part of both the IronPython and the IronRuby projects. Switching to a single repository would be convenient because of this. Having to use git, even indirectly, is a high price to pay though. :-) All the best, Michael I'd rather have the standard library as a 'default' part of the IronPython checkout than the DLR, primarily because a binary distro of the DLR makes more sense. On Sat, Oct 30, 2010 at 05:54, Tristan Zajonctrist...@gmail.com wrote: I've used both hg+bitbucket and git+github. In my experience, there is very little difference between hg and git in terms of workflow. I found both to be great and the tools are pretty mature across all platforms. I do think GitHub is rapidly becoming a killer application for open source projects. If you look at the IronRuby repository (http://github.com/ironruby/ironruby), there are already 340 watchers and 109 forks, which is a non-negligible consideration imho. On Fri, Oct 29, 2010 at 8:10 AM, Noah Giftnoah.g...@gmail.com wrote: On Thu, Oct 28, 2010 at 11:36 PM, Jeff Hardyjdha...@gmail.com wrote: On Thu, Oct 28, 2010 at 6:31 PM, Miguel de Icazamig...@novell.com wrote: Moving to Git seems like a no brainer to me: we only have to move IronPython there. If we were to pick another of the open source source code management systems we would be moving both Ruby and Python away. Where I'm torn is that IronPython is between a rock and a hard place - on the one hand, I want to work closely with the Mono project (which would strongly imply using github), but I also want to be in sync with the Python community (which has largely embraced hg). Python's separated stdlib will be a Mercurial repo, and if IronPython were in Hg we could easily pull in the stdlib as a subrepo. However, I presume the DLR will stay on github, and we'll need to pull that in as well, which of course would be easier from git. Damned if we do, damned if we don't. I'm leaning towards Mercurial because I prefer it, and it seems like many other people do as well. I know hg can pull from git, but I don't know about the reverse. If the concern is the UI for checking code out for Git, there is a transparent bridge that exposes the tree to Subversion which has good Windows clients. Tortoise-Git is actually very nice now. I don't think git's Windows support is really an issue anymore. Haven't tried it, but this looks interesting: http://www.serpentine.com/blog/2010/10/10/dual-bitbucketgithub-citizenship/ - Jeff ___ Users mailing list Users@lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com -- Thanks, Noah ___ 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 list Users@lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com -- http://www.voidspace.org.uk/ ___ Users mailing list Users@lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com
Re: [IronPython] The elephant in the room: source control for IronPython
On 28/10/2010 20:15, Noah Gift wrote: On Thu, Oct 28, 2010 at 6:34 AM, Michael Foord fuzzy...@voidspace.org.uk mailto:fuzzy...@voidspace.org.uk wrote: On 28/10/2010 03:53, Steve Dower wrote: I'll add in a vote for Mercurial (voting always seems to be how to decide on VCS), though I still believe that SVN works better for a contribution/review/patch workflow. Distributed version control systems are very good for distributed development (funny that). Whilst I'm not proposing we use bzr (I would *very* much like us to use mercurial though), our workflow at Canonical with bzr and launchpad is great. You develop in a branch (branching is very easy with dcvs') and push to launchpad. On requesting a merge review you get a great web interface with viewable diff and when the merge is approved you merge back onto trunk. (Branching and merging are substantially easier with hg / bzr / git than with svn.) (From the peanut gallery). One potential benefit to having the project live at Canonical is that Michael works there, and Canonical may be interested in helping officially support it. Stranger things have happened. Hehe, I certainly can't speak for canonical on that score... :-) All the best, Michael ___ Users mailing list Users@lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com -- http://www.voidspace.org.uk/ ___ Users mailing list Users@lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com
Re: [IronPython] All classes that subclass a given type
On 28/10/2010 19:15, Slide wrote: I am trying to find all the classes defined in Python that inherit from a C# class. I can iterate through the types in the ScriptScope using GetVariableName() and then checking if it's a PythonType object, but I don't know how to get the classes that it inherits from. Can anyone help out with this? In normal Python you can call Class.__subclasses__() to get a list of subclasses. I haven't tried this with .NET classes on IronPython though. Also, on a separate note, I would like to override the normal import mechanism to support new file extensions for modules (this is so I can associate the files with my application). Is this possible? You can either patch __builtins__.__import__, use the ihooks module, implement a PEP 302 import loader *or* use the IronPython Platform Application Layer to control how IronPython imports are done (this is how IronPython on Silverlight does imports from the xap file). All the best, Michael Foord Thanks, slide -- http://www.voidspace.org.uk/ ___ Users mailing list Users@lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com
Re: [IronPython] The elephant in the room: source control for IronPython
On 28/10/2010 03:53, Steve Dower wrote: I'll add in a vote for Mercurial (voting always seems to be how to decide on VCS), though I still believe that SVN works better for a contribution/review/patch workflow. Distributed version control systems are very good for distributed development (funny that). Whilst I'm not proposing we use bzr (I would *very* much like us to use mercurial though), our workflow at Canonical with bzr and launchpad is great. You develop in a branch (branching is very easy with dcvs') and push to launchpad. On requesting a merge review you get a great web interface with viewable diff and when the merge is approved you merge back onto trunk. (Branching and merging are substantially easier with hg / bzr / git than with svn.) Having many outstanding branches waiting for review (and keeping them up to date) and starting new branches that depend on other branches is all very easy. Having infrastructure that allows us to easily store feature branches is important for that particular workflow. Is the plan after 2.7 to start doing 3? That seems like a good opportunity to start fresh in a new repository and leave the old stuff where it is, only carrying over the barest minimum. I can't see any movement before 2.7 as being worthwhile. Interesting question. Ideally we would do parallel development but I'm not sure we have the resources for that. I'd like to see the DLR separated, but doing so does make cross-versioning more difficult. However, following a log that has three separate projects (assuming DLR, IronPy and IronRuby) is messy. Patching potentially gets a lot harder as well. I do intend to contribute, as soon as I stop breaking my own project :) How up to date is the CodePlex issue tracker? The issue tracker has been pretty well maintained. All the best, Michael Foord On Thu, Oct 28, 2010 at 18:27, Jeff Hardyjdha...@gmail.com wrote: Currently, IronPython is hosted in a TFS repository on CodePlex (http://ironpython.codeplex.com/), which was a copy of MS's internal TFS repository. CodePlex also provides Subversion access, which makes it much more bearable. CodePlex also hosts our issue tracking and wiki pages, which probably won't change any time soon. IronRuby's source code is hosted on github (http://github.com/ironruby/ironruby). It's also a copy of MS's internal TFS repository, but in git. The interesting part is that IronRuby, IronPython, and the DLR are hosted in the *same* repository, since they evolved together. Thus, both the IronPython CodePlex repo and the IronRuby github repo are basically the same. /history-lesson What this is going to look like in the future is an open question, as is the timeline. Originally, I wanted to focus on the 2.7 release and deal with the source control question later. However, it's been raised in a few places, so I think it's better to get some more feedback on whether we should switch source control methods (and if so, to what?) or just stay on TFS/SVN for the time being. Also up for consideration is whether you consider being part of the same repo as IronRuby is valuable, or whether IronPython should split out on its own. We could, for example, drop the source control from CodePlex and just use the IronRuby github repo - it's already set up and we could start developing tomorrow (although it would probably be renamed 'ironlanguages' or something like that). It's also probably the only option if IronPython and IronRuby are to share a repo, as, so far as I know, the IronRuby guys have no plans on leaving github, which makes sense for them - git is the de facto choice in the Ruby community. In Python, however, it's not so clear-cut - Python itself will be moving to Mercurial soon, and there are plans afoot to eventually put the Python stdlib in a separate repo from Python itself, which will likely also be a Mercurial repository. Thus there are advantages (subrepos, in particular) to being on the same DVCS. On top of that, both Michael Foord and I strongly dislike git - I prefer Mercurial, and I imagine the coffee at Canonical will have Michael singing the praises of bzr fairly soon :). Finally, CodePlex supports Mercurial, and thus everything could remain there if we so wish. However, converting the repo to Mercurial could be a difficult task - the fate of the 1.1, 2.0, and 2.6 branches would have to be decided (include them in the repo, or not? Their structure is radically different from the Main branch). There are folders that could very well be stripped (WiX, Ruby, and *3* CPython installations, not to mention IronRuby) to save space, and with a DVCS once they're in the history everyone has to pay that cost in disk space, forever, even if we later remove them. The fate of the DLR would need to be decided - do we keep a local copy, pull from IronRuby's copy, or make it a third repo altogether? My preference is to stick with TFS/SVN for the time being, get 2.7 out the door (manually syncing up the DLR
Re: [IronPython] Announcing IronPython 2.7 Beta 1
On 22/10/2010 15:46, Vernon Cole wrote: Your issue #2 is not a bug -- or at least it is the same as all other installers. Well, it's *new* as the IronPython installer has never done this before - and I would certainly question whether it is desirable for it to be the *default* for IronPython. IronPython doesn't use .pyc files (and not really .pyw either I think) so it isn't surprising it doesn't change those. I would really prefer that IronPython doesn't seize the association with .py files without explicit instruction from the user . Michael Foord Every version of Python which you install will take over as the default Open command for .py files -- and will supply it's own icon for them. When you are trying out a new Python version, you must remember to re-install your chosen default version afterward, if you expect to double-click a .py and get a certain version of Python to start. The same thing happens with Python 3.1 and 2.7 for example. I use so many different versions that I have given up on the re-install trick. I now use a bunch of .bat files (in a directory on my search path) to pick the version I want. For example, the file py23.bat contains: c:\python23\python.exe %1 %2 %3 %4 %5 %6 %7 %8 %9 and py31.bat contains: c:\python31\python.exe %1 %2 %3 %4 %5 %6 %7 %8 %9 and ipy.bat contains: c:\program files\IronPython 2.7\ipy.exe %1 %2 %3 %4 %5 %6 %7 %8 %9 The file python.bat points to my chosen default version for this week. So to testmyTestScript under IronPython 2.7, I type: ipy myTestScript.py arg1 arg2 The same little c:\utils directory also contains such handy tools as tail.exe, unix2dos.exe, less.exe, and 2to3.bat, which contains: c:\python26\python.exe c:\python26\Tools\Scripts\2to3.py %1 %2 %3 %4 %5 %6 %7 %8 %9 You get the picture... Those of us who's brains are stuck in console mode do this sort of thing. -- Vernon On Fri, Oct 22, 2010 at 6:44 AM, Adal Chiriliuc adal.chiril...@gmail.com mailto:adal.chiril...@gmail.com wrote: Hi, Thanks for making available a new IronPython build. The 2.7 Beta 1 installer has a few issues through: 1. Changing the default installation folder doesn't work: IronPython will be installed in two places: C:\Program Files (x86)\IronPython 2.7 and the installation folder that you specified. 2. If you have already have CPython installed, IronPython will overwrite the icon for .py files, but not for .pyc and .pyw files. Please don't replace the CPython icons or at least make this an installer option. Adal ___ Users mailing list Users@lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com -- http://www.voidspace.org.uk/ READ CAREFULLY. By accepting and reading this email you agree, on behalf of your employer, to release me from all obligations and waivers arising from any and all NON-NEGOTIATED agreements, licenses, terms-of-service, shrinkwrap, clickwrap, browsewrap, confidentiality, non-disclosure, non-compete and acceptable use policies (BOGUS AGREEMENTS) that I have entered into with your employer, its partners, licensors, agents and assigns, in perpetuity, without prejudice to my ongoing rights and privileges. You further represent that you have the authority to release me from any BOGUS AGREEMENTS on behalf of your employer. ___ Users mailing list Users@lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com
Re: [IronPython] The Future of IronPython
On 22/10/2010 18:01, Jeff Hardy wrote: On Fri, Oct 22, 2010 at 10:37 AM, Michael Foord mich...@voidspace.org.uk wrote: If the licenses *are* compatible, so we can ship a fully working zlib module, then fine (and great). It looks like the normal 3-clause BSD licence: http://componentace.com/data/ZLIB_.NET/license.txt, so it should be OK. In that case there should be no problem including it, so long as we also include a copy of the license. Michael - Jeff -- http://www.voidspace.org.uk/ READ CAREFULLY. By accepting and reading this email you agree, on behalf of your employer, to release me from all obligations and waivers arising from any and all NON-NEGOTIATED agreements, licenses, terms-of-service, shrinkwrap, clickwrap, browsewrap, confidentiality, non-disclosure, non-compete and acceptable use policies (”BOGUS AGREEMENTS”) that I have entered into with your employer, its partners, licensors, agents and assigns, in perpetuity, without prejudice to my ongoing rights and privileges. You further represent that you have the authority to release me from any BOGUS AGREEMENTS on behalf of your employer. ___ Users mailing list Users@lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com
Re: [IronPython] Bug in copy module (really need help with this!) :)
On 12/10/2010 15:29, Pablo Dalmazzo wrote: Hello guys, we've found a bug in the copy module, but the real problem is we cant reproduce it. Sometimes when we try to deepcopy an object of a custom object relation mapping type, we get this error name types is not defined Line 55: for t in (type(None),int,long,float,bool,str,tuple), frozenset,type,xrange,types.ClassType,types.BuiltinFunctionType, type(Ellipsis), In my version of Python 2.6 this is line 102 of the copy module. Line 51 is import types, so a name types is not defined error is most perplexing. Is it possible that you are using a custom version of the copy module? All the best, Michael the other problem is in production server, where this error uses to happen sporadically, most times we dont get this message but an error message of the most outer module which calls the copy module, which is a generic message which tells us nothing I know this is very little information to find a bug but, do you know of any bugs related to the module copy (aside it didnt copy System.DBnull which I believe it's not the one for this case) Greetings, Pablo Dalmazzo ___ Users mailing list Users@lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com -- http://www.voidspace.org.uk/ READ CAREFULLY. By accepting and reading this email you agree, on behalf of your employer, to release me from all obligations and waivers arising from any and all NON-NEGOTIATED agreements, licenses, terms-of-service, shrinkwrap, clickwrap, browsewrap, confidentiality, non-disclosure, non-compete and acceptable use policies (BOGUS AGREEMENTS) that I have entered into with your employer, its partners, licensors, agents and assigns, in perpetuity, without prejudice to my ongoing rights and privileges. You further represent that you have the authority to release me from any BOGUS AGREEMENTS on behalf of your employer. ___ Users mailing list Users@lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com
Re: [IronPython] change in standard library behavior for compiled .exe/.dll???
On 05/10/2010 22:27, Ken MacDonald wrote: I've been looking at the .exe's we built - using pyc.py - with IP 2.5/.Net 3.5 and IP2.7 / .NET 4.0. In the 2.7 .exe, it appears that the imports (like os) are not being built into the .exe/.dll, but instead are required to be imported in source form, e.g. os.py must be somewhere on sys.path. In the IP 2.5 .exe's we had been building, they would run fine on machines without the IP standard library installed at all, in other words, with os.py not present on the machine at all. We did notice that the .exe in question went from being 2.9 MB in it's IP 2.5 incarnation, down to 1.2 MB in the IP 2.7 version, and the newer version requires that the source code for the IP standard library be on the path. Is this a deliberate change in behavior? We never had to package the standard library source when we sent out .exe's to customers before Hmmm... I'm pretty sure I always had to explicitly compile and bundle the standard library with previous versions of Python. Odd. Anyway, the simple solution is to ensure that you add any standard library modules you use to the set you compile and ship. All the best, Michael Foord os is not an assembly but a Python module from the standard library. You need to ensure that the Python standard library (or the parts that you use and their dependencies) is on the path. All the best, Michael Foord and how do I ensure it gets found from my .exe - is there a specific env. variable, or the Windows %PATH% e.v., or something I haven't AddReference'd to Thanks, Ken ___ Users mailing list Users@lists.ironpython.com mailto:Users@lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com -- http://www.voidspace.org.uk/blog READ CAREFULLY. By accepting and reading this email you agree, on behalf of your employer, to release me from all obligations and waivers arising from any and all NON-NEGOTIATED agreements, licenses, terms-of-service, shrinkwrap, clickwrap, browsewrap, confidentiality, non-disclosure, non-compete and acceptable use policies (”BOGUS AGREEMENTS”) that I have entered into with your employer, its partners, licensors, agents and assigns, in perpetuity, without prejudice to my ongoing rights and privileges. You further represent that you have the authority to release me from any BOGUS AGREEMENTS on behalf of your employer. -- http://www.voidspace.org.uk/blog READ CAREFULLY. By accepting and reading this email you agree, on behalf of your employer, to release me from all obligations and waivers arising from any and all NON-NEGOTIATED agreements, licenses, terms-of-service, shrinkwrap, clickwrap, browsewrap, confidentiality, non-disclosure, non-compete and acceptable use policies (”BOGUS AGREEMENTS”) that I have entered into with your employer, its partners, licensors, agents and assigns, in perpetuity, without prejudice to my ongoing rights and privileges. You further represent that you have the authority to release me from any BOGUS AGREEMENTS on behalf of your employer. ___ Users mailing list Users@lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com
Re: [IronPython] difference in compiling ipy in 3.5 vs. .NET 4.0?
On 05/10/2010 16:59, Ken MacDonald wrote: I am getting much farther with my app now that I can actually run it as an .exe; and running under VS is a HUGE help. Currently, the app is dying on the following statement: import os When I run it in VS or from the ipy command prompt, import os seems to work fine, dir(os) yields a bunch of symbols, for instance. When I run it as a compiled .exe, it runs up to that point, and dies with an exception no module named os. This seems like it must be some sort of path issue or similar. Where is the assembly for os, os is not an assembly but a Python module from the standard library. You need to ensure that the Python standard library (or the parts that you use and their dependencies) is on the path. All the best, Michael Foord and how do I ensure it gets found from my .exe - is there a specific env. variable, or the Windows %PATH% e.v., or something I haven't AddReference'd to Thanks, Ken ___ Users mailing list Users@lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com -- http://www.voidspace.org.uk/blog READ CAREFULLY. By accepting and reading this email you agree, on behalf of your employer, to release me from all obligations and waivers arising from any and all NON-NEGOTIATED agreements, licenses, terms-of-service, shrinkwrap, clickwrap, browsewrap, confidentiality, non-disclosure, non-compete and acceptable use policies (BOGUS AGREEMENTS) that I have entered into with your employer, its partners, licensors, agents and assigns, in perpetuity, without prejudice to my ongoing rights and privileges. You further represent that you have the authority to release me from any BOGUS AGREEMENTS on behalf of your employer. ___ Users mailing list Users@lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com
Re: [IronPython] expat module for IronPython 2.6 for .NET?
On 10/09/2010 14:56, William Johnston wrote: Hello, Is the expat module available for IronPython 2.6 for .NET? There is an IronPython compatible implementation of expat that is part of the (sadly now defunct) FePy: https://fepy.svn.sourceforge.net/svnroot/fepy/trunk/lib/pyexpat.py All the best, Michael Foord I need to use expat or SimpleXMLTreeBuilder for xml parsing from the following error: ImportError: No module named expat; use SimpleXMLTreeBuilder instead. Thanks, William Johnston ___ Users mailing list Users@lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com -- http://www.ironpythoninaction.com/ http://www.voidspace.org.uk/blog READ CAREFULLY. By accepting and reading this email you agree, on behalf of your employer, to release me from all obligations and waivers arising from any and all NON-NEGOTIATED agreements, licenses, terms-of-service, shrinkwrap, clickwrap, browsewrap, confidentiality, non-disclosure, non-compete and acceptable use policies (BOGUS AGREEMENTS) that I have entered into with your employer, its partners, licensors, agents and assigns, in perpetuity, without prejudice to my ongoing rights and privileges. You further represent that you have the authority to release me from any BOGUS AGREEMENTS on behalf of your employer. ___ Users mailing list Users@lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com
[IronPython] Implementing an IronPython extension mechanism with abstract classes
Hello all, A friend was asking some advice about implementing an IronPython extension system for a C# application. He wanted to use C# abstract classes so that he would get an error attempting to instantiate a plugin class if it didn't implement all the required methods. (The extensions subclass his abstract class.) He pulled the Python class out of an extension script as a PythonType and instantiated it with engine.Operations.Call(PythonClass) - however this doesn't throw the exception he expected. (He does get MissingMember exceptions trying to call methods that don't exist however.) Can this be made to work or is there a better way to do interface checking of Python classes subclassing .NET types? All the best, Michael Foord -- http://www.ironpythoninaction.com/ http://www.voidspace.org.uk/blog READ CAREFULLY. By accepting and reading this email you agree, on behalf of your employer, to release me from all obligations and waivers arising from any and all NON-NEGOTIATED agreements, licenses, terms-of-service, shrinkwrap, clickwrap, browsewrap, confidentiality, non-disclosure, non-compete and acceptable use policies (”BOGUS AGREEMENTS”) that I have entered into with your employer, its partners, licensors, agents and assigns, in perpetuity, without prejudice to my ongoing rights and privileges. You further represent that you have the authority to release me from any BOGUS AGREEMENTS on behalf of your employer. ___ Users mailing list Users@lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com
Re: [IronPython] Unittest Module Unavailable in V2.7a1
On 30/08/2010 16:38, Jones, Larry wrote: My team is currently using VS2010 for work. I want to demonstrate that using IronPython as our unit testing language can be more productive than using either NUnit or Microsoft Test. In order to integrate with VS2010, I believe I must use IronPython 2.7a1. I believe this is the only release that includes the IronPython Tools. However, IronPython 2.7a1 fails when executing 'import unittest'. I've submitted a work item, 28709, to the IronPython issue tracker; however, I'm wondering if another work around exists then writing code in 2.6.1 -- which will execute outside VS2010 -- but cannot be executed from within Visual Studio (it invoke IronPython 2.7a1). The IronPython team is aware of this problem, it was caused by a 'bug' in the tools that package the installer. A simple workaround (that will probably work) is to copy the unittest package from a CPython 2.7 installation into your IronPython Lib directory. In IronPython 2.7 the unittest package is missing some files. All the best, Michael Foord Thanks. Have a great day! ** This e-mail and any attachments are intended only for use by the addressee(s) named herein and may contain legally privileged and/or confidential information. If you are not the intended recipient of this e-mail, you are hereby notified any dissemination, distribution or copying of this email, and any attachments thereto, is strictly prohibited. If you receive this email in error please immediately notify the sender and permanently delete the original copy and any copy of any e-mail, and any printout thereof. ___ Users mailing list Users@lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com -- http://www.ironpythoninaction.com/ ___ Users mailing list Users@lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com
Re: [IronPython] Unittest Module Unavailable in V2.7a1
On 30/08/2010 18:32, Jones, Larry wrote: Thanks, Michael, for the information. I copied the file unittest.py from my IronPython 2.6 installation to my IronPython 2.7 installation. It did seem to work, although discovering that in 2.7 unittest is a directory containing a number of other files, was a bit disconcerting. I renamed the v2.7 unittest directory (to unittest.000) and then copied unittest.py from the IronPython 2.6 installation. I greatly appreciate your help on this. In Python 2.6 unittest was a single file (unittest.py). In Python 2.7 it is a package (a directory containing several modules). The unittest package in Python 2.7 is a lot more capable, but using the Python 2.6 version of unittest.py will certainly work. All the best, Michael Foord *From:* users-boun...@lists.ironpython.com [mailto:users-boun...@lists.ironpython.com] *On Behalf Of *Michael Foord *Sent:* Monday, August 30, 2010 9:33 AM *To:* Discussion of IronPython *Subject:* Re: [IronPython] Unittest Module Unavailable in V2.7a1 On 30/08/2010 16:38, Jones, Larry wrote: My team is currently using VS2010 for work. I want to demonstrate that using IronPython as our unit testing language can be more productive than using either NUnit or Microsoft Test. In order to integrate with VS2010, I believe I must use IronPython 2.7a1. I believe this is the only release that includes the IronPython Tools. However, IronPython 2.7a1 fails when executing 'import unittest'. I've submitted a work item, 28709, to the IronPython issue tracker; however, I'm wondering if another work around exists then writing code in 2.6.1 -- which will execute outside VS2010 -- but cannot be executed from within Visual Studio (it invoke IronPython 2.7a1). The IronPython team is aware of this problem, it was caused by a 'bug' in the tools that package the installer. A simple workaround (that will probably work) is to copy the unittest package from a CPython 2.7 installation into your IronPython Lib directory. In IronPython 2.7 the unittest package is missing some files. All the best, Michael Foord Thanks. Have a great day! ** This e-mail and any attachments are intended only for use by the addressee(s) named herein and may contain legally privileged and/or confidential information. If you are not the intended recipient of this e-mail, you are hereby notified any dissemination, distribution or copying of this email, and any attachments thereto, is strictly prohibited. If you receive this email in error please immediately notify the sender and permanently delete the original copy and any copy of any e-mail, and any printout thereof. ___ Users mailing list Users@lists.ironpython.com mailto:Users@lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com -- http://www.ironpythoninaction.com/ ___ Users mailing list Users@lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com -- http://www.ironpythoninaction.com/ ___ Users mailing list Users@lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com
Re: [IronPython] Prevention of SystemExit Dialog While Debugging
On 31/08/2010 00:13, Jones, Larry wrote: I'm writing unit tests in IronPython. The implementation of unittest.main() calls sys.exit() when finished even if no testing errors occurred. Consequently, the Visual Studio debugger presents a dialog indicating that the SystemExit exception was unhandled. Running from the console, I do not see any evidence of the SystemExit exception. Because my colleagues are not familiar with IronPython, seeing this error in the debugger will cause them to think that some problem occurred on exit. Is your code calling unittest.main() or is Visual Studio calling it for you? In the version of unittest that comes with Python 2.7 you can call unittest.main(exit=False). Alternatively you can just catch and ignore this exception yourself. All the best, Michael Although I suspect I can configure Visual Studio to ignore this exception, I'd prefer not to because it may indicate an actual problem. How can I determine if an IronPython script is running under the VS debugger? Thanks. Have a great day! ** This e-mail and any attachments are intended only for use by the addressee(s) named herein and may contain legally privileged and/or confidential information. If you are not the intended recipient of this e-mail, you are hereby notified any dissemination, distribution or copying of this email, and any attachments thereto, is strictly prohibited. If you receive this email in error please immediately notify the sender and permanently delete the original copy and any copy of any e-mail, and any printout thereof. ___ Users mailing list Users@lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com -- http://www.ironpythoninaction.com/ ___ Users mailing list Users@lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com
Re: [IronPython] If not IronPython, what?
On 23/08/2010 05:51, Rob Brown-Bayliss wrote: On Mon, Aug 23, 2010 at 10:22 AM, Tristan Zajonctrist...@gmail.com wrote: The popularity of the JVM and the CLR suggest not everybody agrees with your assessment. A lot of the 'popularity' comes from people who shouldn't be making the choice. I work for a company where the management think dot net will end poverty, fix global warming and bring world peace while ensuring they grab more of the market than our competition. Every thing has to be dot net to these people, none of whom know what a VM is.It has to be dot net because microsoft sales people tell them so. Well, if languages based on VMs that compile to an intermediate representation first and then interpret bytecode are *bad* then that sends CPython out of the window too... Of course both .NET and the JVM have kick-ass JIT compilers, so maybe it is having a JIT compiler that is bad? That makes CPython good but PyPy and Unladen Swallow bad (along with IronPython and Jython of course). Hmm... The cross-platform story for .NET is not brilliant, with Mono constantly playing catch-up and only just switching away from a leaks-like-hell garbage collector. Other than that the technical arguments that have been presented against .NET in this thread are poor. All the best, Michael Foord Fortunately I can use Ironpython because it has the dot net magic. Unfortunately I cant use cpython because it's just not magic. I agree with Vernon, a VM that basically (I know about mono, but it's always going to be playing catch up) only runs on Windows is a stupid idea. But as long as people who don't know what they are talking about are running the show thats how it will be. -- Rob ___ Users mailing list Users@lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com -- http://www.ironpythoninaction.com/ ___ Users mailing list Users@lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com
[IronPython] ironpython.net down
Hello guys, Looks like someone forgot to pay the hosting bill for ironpython.net (?). Michael Foord -- http://www.ironpythoninaction.com/ http://www.voidspace.org.uk/blog READ CAREFULLY. By accepting and reading this email you agree, on behalf of your employer, to release me from all obligations and waivers arising from any and all NON-NEGOTIATED agreements, licenses, terms-of-service, shrinkwrap, clickwrap, browsewrap, confidentiality, non-disclosure, non-compete and acceptable use policies (”BOGUS AGREEMENTS”) that I have entered into with your employer, its partners, licensors, agents and assigns, in perpetuity, without prejudice to my ongoing rights and privileges. You further represent that you have the authority to release me from any BOGUS AGREEMENTS on behalf of your employer. ___ Users mailing list Users@lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com
Re: [IronPython] ironpython.net down
On 14/08/2010 00:20, Dino Viehland wrote: I pinged someone about it - Jimmy used to take care of these things :) Cool. Michael -Original Message- From: users-boun...@lists.ironpython.com [mailto:users- boun...@lists.ironpython.com] On Behalf Of Michael Foord Sent: Friday, August 13, 2010 4:10 PM To: Discussion of IronPython Subject: [IronPython] ironpython.net down Hello guys, Looks like someone forgot to pay the hosting bill for ironpython.net (?). Michael Foord -- http://www.ironpythoninaction.com/ http://www.voidspace.org.uk/blog READ CAREFULLY. By accepting and reading this email you agree, on behalf of your employer, to release me from all obligations and waivers arising from any and all NON-NEGOTIATED agreements, licenses, terms-of- service, shrinkwrap, clickwrap, browsewrap, confidentiality, non- disclosure, non-compete and acceptable use policies (BOGUS AGREEMENTS) that I have entered into with your employer, its partners, licensors, agents and assigns, in perpetuity, without prejudice to my ongoing rights and privileges. You further represent that you have the authority to release me from any BOGUS AGREEMENTS on behalf of your employer. ___ 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 -- http://www.ironpythoninaction.com/ http://www.voidspace.org.uk/blog READ CAREFULLY. By accepting and reading this email you agree, on behalf of your employer, to release me from all obligations and waivers arising from any and all NON-NEGOTIATED agreements, licenses, terms-of-service, shrinkwrap, clickwrap, browsewrap, confidentiality, non-disclosure, non-compete and acceptable use policies (”BOGUS AGREEMENTS”) that I have entered into with your employer, its partners, licensors, agents and assigns, in perpetuity, without prejudice to my ongoing rights and privileges. You further represent that you have the authority to release me from any BOGUS AGREEMENTS on behalf of your employer. ___ Users mailing list Users@lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com
Re: [IronPython] IronPython Silverlight 4 debugging... [No errors just not working]
On 11/08/2010 17:34, Andrew Evans wrote: Hello I am running IronPython 2.7A and trying to debug a Silverlight app. I am trying to figure out why my ship doesn't move when I press the Arrow keys. here is the complete source minus most imports :D Put some debugging in (append text to an html div) to see if your event handlers are being fired. That would my first step. Michael Any ideas from System.Windows.Input import * velocity = 10 class Gui(): def __init__(self): self.grid = Grid() self.canvas = Canvas(Background = SolidColorBrush(Colors.White)) self.canvas.Width = 640 self.canvas.Height = 432 self.bgImage = Image( Source = BitmapImage(Uri(images/background.jpg, UriKind.Relative)) ) self.canvas.SetTop(self.bgImage, 132) self.canvas.SetLeft(self.bgImage, 0) #self.textblock = TextBlock() ##self.textblock.FontSize = 24 ##self.textblock.Text = 'This Really Works!!' ##self.canvas.Children.Add(self.textblock) self.ship = Image( Source = BitmapImage(Uri(images/ship.png, UriKind.Relative)) ) self.canvas.SetTop(self.ship, 75) self.canvas.SetLeft(self.ship, 25) CompositionTarget.Rendering += EventHandler(self.ShootBG) ##self.GenerateStarField(350) self.canvas.Children.Add(self.bgImage) self.canvas.Children.Add(self.ship) self.grid.Children.Add(self.canvas) Application.Current.RootVisual = self.grid # This line should be something different Not sure what to use instead of this self.ship.KeyDown += KeyEventHandler(self.KeyDown_Control) def ShootBG(self, s, e): self.canvas.SetLeft(self.bgImage, self.canvas.GetLeft(self.bgImage) - 1) if self.canvas.GetLeft(self.bgImage) -2110: self.canvas.SetLeft(self.bgImage, 0) def KeyDown_Control(self, s, e): if e.Key == Key.Right: self.canvas.SetLeft(self.ship, self.canvas.GetLeft(self.ship) + velocity) elif e.Key == Key.Left: self.canvas.SetLeft(self.ship, self.canvas.GetLeft(self.ship) - velocity) elif e.Key == Key.Up: self.canvas.SetTop(self.ship, self.canvas.GetTop(self.ship) - velocity) elif e.Key == Key.Down: self.canvas.SetTop(self.ship, self.canvas.GetTop(self.ship) + velocity) gui = Gui() gui ___ Users mailing list Users@lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com -- http://www.ironpythoninaction.com/ http://www.voidspace.org.uk/blog READ CAREFULLY. By accepting and reading this email you agree, on behalf of your employer, to release me from all obligations and waivers arising from any and all NON-NEGOTIATED agreements, licenses, terms-of-service, shrinkwrap, clickwrap, browsewrap, confidentiality, non-disclosure, non-compete and acceptable use policies (BOGUS AGREEMENTS) that I have entered into with your employer, its partners, licensors, agents and assigns, in perpetuity, without prejudice to my ongoing rights and privileges. You further represent that you have the authority to release me from any BOGUS AGREEMENTS on behalf of your employer. ___ Users mailing list Users@lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com
Re: [IronPython] Exception Performance
On 03/08/2010 16:41, Jeff Hardy wrote: Hi Cory, On Mon, Aug 2, 2010 at 12:41 PM, Cory Brostowicz cory.brostow...@gmail.com wrote: Hello, I noticed the performance in one of my python scripts has really bad performance, so I started profiling different sections of the script to find out where the issue is. It turns out, the exception handle seems to add the biggest chunk of time. IronPython 2.6 and earlier rely on the .NET exception mechanism. .NET's exception handling is extremely slow, whereas CPython has an extremely fast exception handling system. I don't know the details of why each is the way it is, though - engineering tradeoffs, I guess. IronPython 2.7 will have a 'lightweight' exception mechanism that should be closer to the performance of CPython. I've fairly new to the Python language, so if there is a better way to do what I'm doing, then please let me know. Unfortunately, I think that's pretty much idiomatic Python, which often relies on it's very fast exception handling. In .NET you use the Try* methods instead, which don't throw exceptions. If you don't need CPython compatibility, you could use System.Double.TryParse (http://msdn.microsoft.com/en-us/library/994c0zb1.aspx), but I don't know how to use out parameters from IronPython off the top of my head. out parameters are returned as extra values when you make the call. (So you don't pass in the out parameter - but you get an extra return value.) Michael On an unrelated note, you can write your print statement as: print Total: %s RateGet: %s RateSets: %s Exception Handle: %s Rate: %s % (t.Elapsed.TotalMilliseconds, rateGet, rateSet, e.Elapsed.TotalMilliseconds, Rate) - Jeff ___ Users mailing list Users@lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com -- http://www.ironpythoninaction.com/ http://www.voidspace.org.uk/blog READ CAREFULLY. By accepting and reading this email you agree, on behalf of your employer, to release me from all obligations and waivers arising from any and all NON-NEGOTIATED agreements, licenses, terms-of-service, shrinkwrap, clickwrap, browsewrap, confidentiality, non-disclosure, non-compete and acceptable use policies (”BOGUS AGREEMENTS”) that I have entered into with your employer, its partners, licensors, agents and assigns, in perpetuity, without prejudice to my ongoing rights and privileges. You further represent that you have the authority to release me from any BOGUS AGREEMENTS on behalf of your employer. ___ Users mailing list Users@lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com
Re: [IronPython] Building IronPython from sources
On 28/07/2010 16:04, Dave Fugate wrote: Hi Lukas, while IronPython 2.6.x itself won't be able to take advantage of Silverlight 4 features as it's built against Silverlight 3, I'd guess your Python scripts might be able to utilize these features. The differences between Silverlight 3 and 4 are documented at http://www.silverlight.net/getstarted/overview.aspx. I've used Silverlight 4 features from IronPython 2.6. Michael *From:* users-boun...@lists.ironpython.com [mailto:users-boun...@lists.ironpython.com] *On Behalf Of *Lukas Cenovsky *Sent:* Tuesday, July 27, 2010 11:06 AM *To:* Discussion of IronPython *Subject:* Re: [IronPython] Building IronPython from sources Thanks for the info Dave. However, I still smell a catch here :-) What means no build support for IronPython 2.6.x and Silverlight 4 - considering the functionality? Can I use all functionality of Silverlight 4 with Silverlight 3 based assemblies? What is a difference between Silverlight 3 and Silverlight 4 based assemblies? -- -- Lukas On 27.7.2010 19:18, Dave Fugate wrote: Hi Lukas, the deal is IronPython 2.6.x (where x0) will /run/ against .NET 2.0 SP1, .NET 4.0, Silverlight 3, and *Silverlight 4*. You'll only be able to /build/ IronPython 2.6.x against .NET 2.0 SP1, .NET 4.0, and Silverlight 3 though. In other words, we will not be back porting Silverlight 4 /build/ support to the 2.6.x release series as we're really trying to limit 2.6.2 and later 2.6.x releases to bug fixes only. With IronPython 2.7, we'll provide .NET 4.0 and Silverlight 4 based assemblies. This said, we intend on continuing to provide the capability of /building/ IronPython 2.7 against .NET 3.5 and Silverlight 3 via IronPython sources obtained from the DLR CodePlex source repository. Thanks, Dave *From:* users-boun...@lists.ironpython.com mailto:users-boun...@lists.ironpython.com [mailto:users-boun...@lists.ironpython.com] *On Behalf Of *Lukas Cenovsky *Sent:* Tuesday, July 27, 2010 9:49 AM *To:* Discussion of IronPython *Subject:* Re: [IronPython] Building IronPython from sources I am a little bit confused about Silverlight, .NET and IronPython versions. Here is a list what I think is valid, please correct me if I am wrong: * IronPython 2.6.1 supports Silverlight 3 + .NET 2 SP1 * IronPython 2.6.1 does not support Silverlight 4 + .NET 2 SP1 or Silverlight 4 + .NET 4 * IronPython 2.7 will support Silverlight 4 + .NET 4 What will IronPython 2.6.2 support? -- -- Lukas On 27.7.2010 17:31, Dave Fugate wrote: I'd actually suggest doing this with 2.7 Alpha 1 sources... *Building* 2./6.1/ requires a Silverlight /3./x installation as there were changes to System.Core (e.g., System.Func) between Silverlight 3.x and Silverlight 4.x. As you've discovered, we implemented some of this missing System.Core functionality ourselves in 2.6.1 which is confusing the compiler when there's references to both (4.x) System.Core and MS.Scripting.Utils. If you can't get your hands on a Silverlight 3.x installation to fix this, the next easiest route IMO would be to use 2.7A1 instead. *From:* users-boun...@lists.ironpython.com mailto:users-boun...@lists.ironpython.com [mailto:users-boun...@lists.ironpython.com] *On Behalf Of *Lukas Cenovsky *Sent:* Tuesday, July 27, 2010 8:09 AM *To:* Discussion of IronPython *Subject:* Re: [IronPython] Building IronPython from sources Thanks. Copying my current Silverlight version 4.0.50524.0 to 3.0.50106.0 helped and Microsoft.Scripting.dll compiles fine. Now I get many following errors for Microsoft.Dynamic.dll: Error1'Func' is an ambiguous reference between 'System.FuncT0,T1,T2,T3,T4,TRet' and 'Microsoft.Scripting.Utils.FuncT0,T1,T2,T3,T4,TRet' C:\IronPython-2.6.1\Src\Runtime\Microsoft.Dynamic\Interpreter\Instructions\CallInstruction.Generated.cs 27870Microsoft.Dynamic How can I tell Visual Studio to use reference from Microsoft.Scripting.Utils? Thanks. -- -- Lukas On 26.7.2010 18:21, Dave Fugate wrote: Hi Lukas, the error message below is because you don't have the version of Silverlight installed which was used to build IronPython 2.6.1. For this particular release, I believe it was something like %ProgramFiles%\Microsoft Silverlight\3.0.40624.0. You can find out for sure by examining the Silverlight3Path element in Src\IronPython\IronPython.csproj. Any ways, there are two workarounds: Replace all instances of 3.0.40624.0 throughout all C# project files with the version of Silverlight you have installed locally Copy and rename the version of Silverlight you have installed to whatever is expected by the C# project files Hope that helps, Dave *From:* users-boun...@lists.ironpython.com mailto:users-boun...@lists.ironpython.com [mailto:users-boun...@lists.ironpython.com] *On Behalf Of *Lukas Cenovsky *Sent:* Friday, July 23, 2010 12:37 PM *To:* Discussion of IronPython *Subject:* [IronPython] Building IronPython
Re: [IronPython] unittest broken in IPy 2.7A1
On 25/07/2010 01:56, Vernon Cole wrote: Dear development team: This one may be important... This error is because although the unittest package directory is present in the Lib directory, big chunks of the actual unittest package are missing... Michael c:\program files\IronPython 2.7\ipy.exe IronPython 2.7 Alpha 1 (2.7.0.1) on .NET 4.0.30319.1 Type help, copyright, credits or license for more information. import unittest Traceback (most recent call last): File stdin, line 1, in module File c:\program files\IronPython 2.7\Lib\unittest\__init__.py, line 58, in module ImportError: No module named result Makes it a bit tough to test my modules. -- Vernon ___ Users mailing list Users@lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com -- http://www.ironpythoninaction.com/ http://www.voidspace.org.uk/blog READ CAREFULLY. By accepting and reading this email you agree, on behalf of your employer, to release me from all obligations and waivers arising from any and all NON-NEGOTIATED agreements, licenses, terms-of-service, shrinkwrap, clickwrap, browsewrap, confidentiality, non-disclosure, non-compete and acceptable use policies (BOGUS AGREEMENTS) that I have entered into with your employer, its partners, licensors, agents and assigns, in perpetuity, without prejudice to my ongoing rights and privileges. You further represent that you have the authority to release me from any BOGUS AGREEMENTS on behalf of your employer. ___ Users mailing list Users@lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com
Re: [IronPython] Time out
On 26/07/2010 15:51, Scott Holden wrote: I'm currently dealing with the same issue. So far, a separate thread is the only thing I've come up with, but Thread.Abort seems a bit drastic, and may be hazardous to your health... Is there a safer way? I've not had problems with use of Thread.Abort. You could do it another process altogether of course... Not aware of any easy alternatives. Michael On Fri, Jul 23, 2010 at 8:57 AM, Michael Foord fuzzy...@voidspace.org.uk mailto:fuzzy...@voidspace.org.uk wrote: On 23/07/2010 14:49, Saeli Mathieu wrote: Hello, I'm sending this email to get more information about a specific using of ironPython. I'm working on a Silverlight 4 project and I'm using IronPython to execute script inside my C# code. The main objective is to allow users to code an AI and send it into our application. The AI will use the C# we made. That's works fine. :) But I want to prevent the user to create an infinite loop. I browsed the Online documentation but I couldn't find any information about time out execution Funcbool func = scope.GetVariableFuncbool (MainLoop); this.Result = func().ToString(); this.Result will contain a string with the error of the Python Script if something wrong appended. ex: indentation or anything else. but I want to make the method scope.GetVariable() time out if the script contain an infinite loop. Does anybody know something about that ? The only way I can think of doing it is to execute the code on a different thread and then abort the thread if it exceeds the timeout. Michael Sincerely -- Saeli Mathieu. +33 6 45 32 78 47 {Epitech} 2012 Permanent GDL http://www.gamelab.epitech.net/ ___ Users mailing list Users@lists.ironpython.com mailto:Users@lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com -- http://www.ironpythoninaction.com/ ___ Users mailing list Users@lists.ironpython.com mailto: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 -- http://www.ironpythoninaction.com/ http://www.voidspace.org.uk/blog READ CAREFULLY. By accepting and reading this email you agree, on behalf of your employer, to release me from all obligations and waivers arising from any and all NON-NEGOTIATED agreements, licenses, terms-of-service, shrinkwrap, clickwrap, browsewrap, confidentiality, non-disclosure, non-compete and acceptable use policies (BOGUS AGREEMENTS) that I have entered into with your employer, its partners, licensors, agents and assigns, in perpetuity, without prejudice to my ongoing rights and privileges. You further represent that you have the authority to release me from any BOGUS AGREEMENTS on behalf of your employer. ___ Users mailing list Users@lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com
Re: [IronPython] Problems with simple silverlight/gestalt example
On 26/07/2010 23:51, Tony Meyer wrote: Hi, I guess this is more complex than I thought. Is anyone able to simply confirm that they are able to get a simple script like this (using gestalt.ironpython.net) working? At least if I know that it's theoretically possible, I can try and figure out what I'm doing wrong. Are you trying to view the html file direct off the filesystem? You still need to serve it for it to work, even if it is only locally. You can use chiron to do this. Sorry if this has already been suggested. All the best, Michael Thanks, Tony On Thu, Jul 22, 2010 at 10:03 PM, Tony Meyertony.me...@gmail.com wrote: Hi, I'm trying to get a simple Silverlight example working using the gestalt.ironpython.net method, and I'm having some difficulty - basically nothing happens (Loading... shows, of course, but nothing else). The javascript file does get loaded, and I have let it sit for a long time in case it was just excessively slow. I've tried the HTML below in Safari 5, Firefox 3.5.3, Chrome 5.0 (OS X 10.5), IE 7 (Windows Server 2003) and IE 8 (Windows XP SP2 - yes, yes, I know it should be updated!). Both have the latest version of Silverlight (as determined by Silverlight itself). Can anyone explain what I'm doing wrong? Thanks, Tony html head script type=text/javascript src=http://gestalt.ironpython.net/dlr-latest.js;/script /head body div id=messageLoading.../div script type=text/python document.message.innerHTML = Hello from IronPython! def on_click(obj, args): obj.innerHTML = Clicked! document.message.events.onclick += onclick /script /body /html ___ Users mailing list Users@lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com -- http://www.ironpythoninaction.com/ http://www.voidspace.org.uk/blog READ CAREFULLY. By accepting and reading this email you agree, on behalf of your employer, to release me from all obligations and waivers arising from any and all NON-NEGOTIATED agreements, licenses, terms-of-service, shrinkwrap, clickwrap, browsewrap, confidentiality, non-disclosure, non-compete and acceptable use policies (”BOGUS AGREEMENTS”) that I have entered into with your employer, its partners, licensors, agents and assigns, in perpetuity, without prejudice to my ongoing rights and privileges. You further represent that you have the authority to release me from any BOGUS AGREEMENTS on behalf of your employer. ___ Users mailing list Users@lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com
Re: [IronPython] Time out
On 23/07/2010 14:49, Saeli Mathieu wrote: Hello, I'm sending this email to get more information about a specific using of ironPython. I'm working on a Silverlight 4 project and I'm using IronPython to execute script inside my C# code. The main objective is to allow users to code an AI and send it into our application. The AI will use the C# we made. That's works fine. :) But I want to prevent the user to create an infinite loop. I browsed the Online documentation but I couldn't find any information about time out execution Funcbool func = scope.GetVariableFuncbool (MainLoop); this.Result = func().ToString(); this.Result will contain a string with the error of the Python Script if something wrong appended. ex: indentation or anything else. but I want to make the method scope.GetVariable() time out if the script contain an infinite loop. Does anybody know something about that ? The only way I can think of doing it is to execute the code on a different thread and then abort the thread if it exceeds the timeout. Michael Sincerely -- Saeli Mathieu. +33 6 45 32 78 47 {Epitech} 2012 Permanent GDL http://www.gamelab.epitech.net/ ___ Users mailing list Users@lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com -- http://www.ironpythoninaction.com/ ___ Users mailing list Users@lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com
Re: [IronPython] IronPython and Silverlight -- newbie question
On 20/07/2010 16:30, Funke, Matt wrote: I've really enjoyed /IronPython In Action/, and have found it immensely helpful in my quest to understand integrating Python with WPF. (I'm something of a newbie.) Unfortunately, I've hit a conceptual wall with Sliverlight. In particular, creating the *app.xap* file for the source code in *chapter13\13.1.3\ControlsExample1* seems to be hitting a roadblock. Here's the command I gave to Chiron from within the chpter13 directory: *C:\Users\mfunke\Documents\Programming Reference\Python\Libraries\IronPython\IronPython In Action\sourcecode\chapter13bin/Chiron /d:13.1.3/ControlsExample1 /z:app.xap* Chiron gave me this feedback: *Generating XAP C:\Users\mfunke\Documents\Programming Reference\Python\Libraries\IronPython\IronPython In Action\sourcecode\chapter13\app.xap from C:\Users\mfunke\Documents\Programming Reference\Python\Libraries\IronPython\IronPython In Action\sourcecode\chapter13\13.1.3\ControlsExample1* I then moved *app.xap* from *C:\Users\mfunke\Documents\Programming Reference\Python\Libraries\IronPython\IronPython In Action\sourcecode\chapter13* to *C:\Users\mfunke\Documents\Programming Reference\Python\Libraries\IronPython\IronPython In Action\sourcecode\chapter13\13.1.3\ControlsExample1* and opened *index.html*. That's what generated the error in the attached screenshot. Can anyone help me? How */should/* I be generating app.xap, and where should it live? I'm running IronPython 2.6.1 for .NET 4.0, as well as .NET 4.0 (naturally) and Silverlight 4. Thanks in advance for any help you can give. Hey Matt, The IronPython in Action binaries include IronPython 2 (Python 2.5), which unfortunately isn't compatible with Silverlight 4 due to core-clr API changes (grrr). If you replace the IronPython binaries in the examples with the IronPython 2.6.1 IronPython for Silverlight binaries then all the code should just work. I need to update the examples and get Manning to use the later version - my apologies. All the best, Michael Foord -- Best Regards, Matt Funke ___ Users mailing list Users@lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com -- http://www.ironpythoninaction.com/ ___ Users mailing list Users@lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com
Re: [IronPython] IPy Dependencies?
On 12/07/2010 19:31, Funke, Matt wrote: Is there any chance that IronPython has dependencies on PyQt or anything like that? Absolutely no chance at all. :-) Michael My copy of PyScripter (1.9.9.7) stopped working after I tried to use it to edit some scripts I was building for IronPython. Rebooting and re-installing has not fixed the problem. I'm just trying to troubleshoot and investigate all possibilities. -- Best Regards, Matt Funke *From:* users-boun...@lists.ironpython.com [mailto:users-boun...@lists.ironpython.com] *On Behalf Of *Dino Viehland *Sent:* Monday, July 12, 2010 2:14 PM *To:* Discussion of IronPython *Subject:* Re: [IronPython] compiling an executable with the standard library socket is actually a built-in in IronPython. So you really only need threading. But threading depends upon functools, and collections, and traceback. I'm not sure how far the transitive closure goes so let's just assume you'll need to compile the entire standard library. You can actually compile this into its own DLL using pyc. So you could do: import System import pyc files = System.IO.Directory.GetFiles(r'C:\Program Files (x86)\IronPython 2.6\Lib') files = [f for f in files if f.endswith('.py')] import pyc pyc.Main(files + ['/out:stdlib.dll']) I'm just importing pyc directly here because for whatever reason it doesn't accept wildcards. There's a bug in 2.6.1 which prevents this from working -- it'll be fixed in 2.6.2. You could compile w/ 2.6.0 to get a working EXE or you could remove any std lib modules that fail to compile. Now you can just do a clr.AddReference('stdlib.dll') in your script and the std lib will be available to you. *From:* users-boun...@lists.ironpython.com [mailto:users-boun...@lists.ironpython.com] *On Behalf Of *Andrew Evans *Sent:* Monday, July 12, 2010 10:50 AM *To:* Discussion of IronPython *Subject:* [IronPython] compiling an executable with the standard library I am having problems compiling an executable. From what research I have done, I need to include in my compilation the python standard modules that I am using. How ever I can not figure out how to do this. Any advice would be appreciated here is the command I am using ipy path to pyc\pyc.py /main:path to app\p2pChat.py /target:exe these are the modules used in my script import socket from threading import * Thank you in advance ___ Users mailing list Users@lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com -- http://www.ironpythoninaction.com/ http://www.voidspace.org.uk/blog READ CAREFULLY. By accepting and reading this email you agree, on behalf of your employer, to release me from all obligations and waivers arising from any and all NON-NEGOTIATED agreements, licenses, terms-of-service, shrinkwrap, clickwrap, browsewrap, confidentiality, non-disclosure, non-compete and acceptable use policies (BOGUS AGREEMENTS) that I have entered into with your employer, its partners, licensors, agents and assigns, in perpetuity, without prejudice to my ongoing rights and privileges. You further represent that you have the authority to release me from any BOGUS AGREEMENTS on behalf of your employer. ___ Users mailing list Users@lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com
Re: [IronPython] compiling an executable with the standard library
On 12/07/2010 23:56, Andrew Evans wrote: A quick thought do I need to reference Threading by doing something like stdlib.Threading or can I just do from Threading import * Threading is imported from .NET and not from a Python library. The usual import is from System.Threading import Thread etc. Michael On Mon, Jul 12, 2010 at 3:54 PM, Andrew Evans evans.d.and...@gmail.com mailto:evans.d.and...@gmail.com wrote: Hell ty for your fast reply. I compiled the dll using your script. I then did a clr.AddReference in my py code. I also switched to Python 2.6.0. I compiled my code and copied the necessary dlls from my IronPython install to my my executable output directory along with my xaml file. How ever when I run my app from command p2pChat.exe it crashes with no error messages and returns to a shell. This is the contents of my Directory p2p/ IronPython.dll IronPython.Modules.dll IronPython.Modules.XML IronPython.XML Microsoft.Dynamic.dll Microsoft.Scripting.Core.dll Microsoft.Scripting.Debugging.dll Microsoft.Scripting.dll Microsoft.Scripting.ExtensionAttribute.dll p2pChat.dll p2pChat.exe p2pChat.py p2pChat.xaml stdlib.dll Any ideas cheers Andrew On Mon, Jul 12, 2010 at 11:13 AM, Dino Viehland di...@microsoft.com mailto:di...@microsoft.com wrote: socket is actually a built-in in IronPython. So you really only need threading. But threading depends upon functools, and collections, and traceback. I’m not sure how far the transitive closure goes so let’s just assume you’ll need to compile the entire standard library. You can actually compile this into its own DLL using pyc. So you could do: import System import pyc files = System.IO.Directory.GetFiles(r'C:\Program Files (x86)\IronPython 2.6\Lib') files = [f for f in files if f.endswith('.py')] import pyc pyc.Main(files + ['/out:stdlib.dll']) I’m just importing pyc directly here because for whatever reason it doesn’t accept wildcards. There’s a bug in 2.6.1 which prevents this from working – it’ll be fixed in 2.6.2. You could compile w/ 2.6.0 to get a working EXE or you could remove any std lib modules that fail to compile. Now you can just do a clr.AddReference(‘stdlib.dll’) in your script and the std lib will be available to you. *From:* users-boun...@lists.ironpython.com mailto:users-boun...@lists.ironpython.com [mailto:users-boun...@lists.ironpython.com mailto:users-boun...@lists.ironpython.com] *On Behalf Of *Andrew Evans *Sent:* Monday, July 12, 2010 10:50 AM *To:* Discussion of IronPython *Subject:* [IronPython] compiling an executable with the standard library I am having problems compiling an executable. From what research I have done, I need to include in my compilation the python standard modules that I am using. How ever I can not figure out how to do this. Any advice would be appreciated here is the command I am using ipy path to pyc\pyc.py /main:path to app\p2pChat.py /target:exe these are the modules used in my script import socket from threading import * Thank you in advance ___ Users mailing list Users@lists.ironpython.com mailto: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 -- http://www.ironpythoninaction.com/ http://www.voidspace.org.uk/blog READ CAREFULLY. By accepting and reading this email you agree, on behalf of your employer, to release me from all obligations and waivers arising from any and all NON-NEGOTIATED agreements, licenses, terms-of-service, shrinkwrap, clickwrap, browsewrap, confidentiality, non-disclosure, non-compete and acceptable use policies (”BOGUS AGREEMENTS”) that I have entered into with your employer, its partners, licensors, agents and assigns, in perpetuity, without prejudice to my ongoing rights and privileges. You further represent that you have the authority to release me from any BOGUS AGREEMENTS on behalf of your employer. ___ Users mailing list Users@lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com
Re: [IronPython] Adding more than one entry to a TextBox WPF
On 11/07/2010 22:06, Andrew Evans wrote: Hello I am building a simple python app to further educate myself. I am almost some what complete with this application. However I can not think how to add more than one entry to a TextBox. So when I input the first value it stays and then the second value third and so forth right now it replaces the first value with the second etc etc You currently have this for setting the text in the textbox: self.output.Text = str(self.entry_input.Text + \n) This replaces the current text with next text. Instead try: self.output.Text += (self.entry_input.Text + \n) No need for the call to str - the Text property of a textbox is already a string. All the best, Michael Here is my app code #PYTHON# import clr clr.AddReference(PresentationFramework) clr.AddReference(PresentationCore) from System.IO import File from System.Windows.Markup import XamlReader from System.Windows import * import socket from threading import * import cPickle CMD_MSG = range(1) class Chat(object): def __init__(self): mythread = Thread(target=self.server) mythread.start() stream = File.OpenRead(p2pChat.xaml) self.root = XamlReader.Load(stream) self.ip_address_input = self.root.FindName('ip_address') self.sendB = self.root.FindName('send') self.output = self.root.FindName('textbox') self.entry_input = self.root.FindName('entry') self.sendB.Click += self.sendit def server(self): self.port = 9000 self.s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM) self.s.bind((socket.gethostbyname(socket.gethostname()), int(self.port))) #print socket.gethostbyname(socket.gethostname()) while True: msg, addr = self.s.recvfrom(2024) ##cmd, msg = ord(msg[0]),msg[1:] ##if cmd == CMD_MSG: self.output.Text = str(msg) + \n def client(self, msg): self.port = 9000 self.host = self.ip_address_input.Text self.se http://self.se = socket.socket(socket.AF_INET, socket.SOCK_DGRAM) self.se.sendto(str(self.host) + : + msg, (self.host, int(self.port))) def sendit(self, s, e): self.client(str(self.entry_input.Text)) self.output.Text = str(self.entry_input.Text + \n) self.entry_input.Text = myChat = Chat() app = Application() app.Run(myChat.root) Thanks in advance :-) ___ Users mailing list Users@lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com -- http://www.ironpythoninaction.com/ http://www.voidspace.org.uk/blog READ CAREFULLY. By accepting and reading this email you agree, on behalf of your employer, to release me from all obligations and waivers arising from any and all NON-NEGOTIATED agreements, licenses, terms-of-service, shrinkwrap, clickwrap, browsewrap, confidentiality, non-disclosure, non-compete and acceptable use policies (BOGUS AGREEMENTS) that I have entered into with your employer, its partners, licensors, agents and assigns, in perpetuity, without prejudice to my ongoing rights and privileges. You further represent that you have the authority to release me from any BOGUS AGREEMENTS on behalf of your employer. ___ Users mailing list Users@lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com
Re: [IronPython] Compiling so that IronPython libraries are recognized?
On 09/07/2010 14:50, Funke, Matt wrote: I'm extremely new to compiling things in anything approaching a pythonic way, so my apologies in advance for what's probably a very simplistic question. I've downloaded the source for psycopg2-2.2.1. The documentation recommends using the standard python setup.py build and python setup.py install. So I tried to run ipy setup.py build to incorporate these libraries into IronPython. I get this error: Traceback (most recent call last): File setup.py, line 50, inmodule ImportError: No module named subprocess subprocess relies on modules like signal that aren't available in IronPython 2.6.1. There is a partial implementation of subprocess by Jeff Hardy floating around that you could try. In general the IronPython support for distutils is minimal, so I still wouldn't expect normal module installation to work. All the best, Michael I can verify that subprocess.py is in C:\Users\me\AppData\Local\Microsoft\VisualStudio\10.0\Extensions\Microsoft\IronPython Tools for Visual Studio\0.2\Lib. Do I need to add this directory to an environment variable (like PATH), or is there some other way I can notify IronPython about where to look for library files? Thanks for your time. -- Best Regards, Matt Funke ___ Users mailing list Users@lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com -- http://www.ironpythoninaction.com/ http://www.voidspace.org.uk/blog READ CAREFULLY. By accepting and reading this email you agree, on behalf of your employer, to release me from all obligations and waivers arising from any and all NON-NEGOTIATED agreements, licenses, terms-of-service, shrinkwrap, clickwrap, browsewrap, confidentiality, non-disclosure, non-compete and acceptable use policies (”BOGUS AGREEMENTS”) that I have entered into with your employer, its partners, licensors, agents and assigns, in perpetuity, without prejudice to my ongoing rights and privileges. You further represent that you have the authority to release me from any BOGUS AGREEMENTS on behalf of your employer. ___ Users mailing list Users@lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com
Re: [IronPython] using XAML in IronPython
On 09/07/2010 23:14, Andrew Evans wrote: Hello I am learning IronPython having come from a CPython background, I started learning C# to add more to my knowledge base for IronPython. I have a few questions using XAML: First if I build something using the xaml designer in IronPython Studio Don't do that, really. IronPython Studio uses IronPython 1 which is years out of date. Plus it is very unstable. Use IronPython Tools for Visual Studio 2010 instead: http://ironpython.net/ironpython/tools/ I don't think the xaml designer works particularly well with IronPython Tools, but you can use the xaml designer in Expression or Visual Studio (Express). and give it a name x:name=somename and want to reference it in a function def doSomething(s, e): how do I reference the item with the x:name value do I just type somename = changePropertyofControl? and how do I call the function? Controls with an x:Name can be accessed as named attributes on parent controls. Something like: def doSomething(s, e): button = root.hello # also equals s as it happens root = XamlReader.Load(FileStream('Hello_World.xaml', FileMode.Open)) app.Run(root) HTH, Michael XAML Window xmlns=http://schemas.microsoft.com/winfx/2006/xaml/presentation; xmlns:x=http://schemas.microsoft.com/winfx/2006/xaml; Title=Hello World Height=300 Width=300 Button x:Name=helloClick Me/Button /Window Python Code is where I am confused import clr clr.AddReference('PresentationFramework') from System.Windows.Markup import XamlReader from System.Windows import Application from System.IO import FileStream, FileMode app = Application() def doSomething(sender,event): hello.Content = Try again app.Run(XamlReader.Load(FileStream('Hello_World.xaml', FileMode.Open))) This I am sure is really simple... Coming from a Tk background its confusing for me. Anyway ty Cheers Andrew ___ Users mailing list Users@lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com -- http://www.ironpythoninaction.com/ http://www.voidspace.org.uk/blog READ CAREFULLY. By accepting and reading this email you agree, on behalf of your employer, to release me from all obligations and waivers arising from any and all NON-NEGOTIATED agreements, licenses, terms-of-service, shrinkwrap, clickwrap, browsewrap, confidentiality, non-disclosure, non-compete and acceptable use policies (BOGUS AGREEMENTS) that I have entered into with your employer, its partners, licensors, agents and assigns, in perpetuity, without prejudice to my ongoing rights and privileges. You further represent that you have the authority to release me from any BOGUS AGREEMENTS on behalf of your employer. ___ Users mailing list Users@lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com
Re: [IronPython] IronPython/Silverlight -- callback problem
On 08/07/2010 12:28, Jan-Philip Gehrcke wrote: Thanks for your comment, Michael. I found the explanation in the docs: http://msdn.microsoft.com/en-us/library/ms619201(v=VS.95).aspx The default setting is `BitmapCreateOptions.DelayCreation` - Causes a BitmapSource object to delay initialization until it is necessary. This is useful when dealing with collections of images. This is the default value of the BitmapImage.CreateOptions property in Silverlight. Now, I change this to `BitmapCreateOptions.None` and add the callbacks before assigning the URI: Great - glad you got it sorted. Michael def load_and_show(self): self.bi = BitmapImage() self.bi.CreateOptions = BitmapCreateOptions.None; self.bi.ImageOpened += self.successfully_loaded_now_show self.bi.ImageFailed += self.load_failed self.bi.UriSource = Uri(self.abspath, UriKind.Absolute) def successfully_loaded_now_show(self, s, e): self.xaml_main_image.Source = self.bi This works as expected. Jan-Philip On 07.07.2010 18:49, Michael Foord wrote: On 06/07/2010 15:59, Jan-Philip Gehrcke wrote: Hello, I don't know if this is more an IronPython (2.6.1) issue than a Silverlight (4) issue, but I hope that I am talking to the right audience again (thank you for the great answers last time). I've created an `Image` class managing images based on System.Windows.Media.Imaging.BitmapImage. My method `image_instance.load_and_show()` should load the image from a given URI and then show it in an XAML image / element. The important thing is that the showing part should only happen after it is sure that the image has loaded correctly. To control this, I use the BitmapImage.ImageOpened event. This is the relevant part of the code from my `Image` class: def load_and_show(self): self.bi = BitmapImage(Uri(self.abspath, UriKind.Absolute)) self.bi.ImageOpened += self.successfully_loaded_now_show self.bi.ImageFailed += self.load_failed #self.xaml_main_image.Source = self.bi # LINE A def successfully_loaded_now_show(self, s, e): debug(image loaded: %s % s.UriSource) # LINE B self.xaml_main_image.Source = self.bi # LINE C def load_failed(self, s, e): debug(image load failed) # LINE D If the code is like shown above and I do `image_instance.show_and_load()`, nothing happens. More exactly, LINE B, C, and D are not reached. It is like *neither the event ImageOpened nor ImageFailed is toggled*. It seems likely then that the image is not opened or downloaded until you set it as the source on an image. Does the code behave differently if you write it in C#? If you set the bitmapimage as the image source does the event then fire correctly? If so perhaps create the image control but only add it to the visual tree once the bitmap has loaded. Michael If I re-activate (or un-outcomment =)) LINE A, the callbacks magically work properly, i.e. after calling `image_instance.show_and_load()` the image shows up in the UI (either via LINE A or C), and LINE B is definitely reached (or LINE D in case of a wrong URI). The point is that I don't want LINE A, because showing the image should happen in a more controlled manner. What's the problem in my approach, why are the callbacks not called? Thank you in advance, Jan-Philip Gehrcke -- http://gehrcke.de ___ 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 -- http://www.ironpythoninaction.com/ http://www.voidspace.org.uk/blog READ CAREFULLY. By accepting and reading this email you agree, on behalf of your employer, to release me from all obligations and waivers arising from any and all NON-NEGOTIATED agreements, licenses, terms-of-service, shrinkwrap, clickwrap, browsewrap, confidentiality, non-disclosure, non-compete and acceptable use policies (”BOGUS AGREEMENTS”) that I have entered into with your employer, its partners, licensors, agents and assigns, in perpetuity, without prejudice to my ongoing rights and privileges. You further represent that you have the authority to release me from any BOGUS AGREEMENTS on behalf of your employer. ___ Users mailing list Users@lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com
Re: [IronPython] Write permissions
On 08/07/2010 09:37, Rob Brown-Bayliss wrote: Hi I have begun playing with ironpython and wpf. I come from a python on linux with gtk+ background. I have a problem with vista and trying to open a log file via the logging module: Access to the path 'C:\log.txt' is denied. Writing to C: in Vista and Windows 7 requires elevated permissions so your application will require admin privileges. Can you not choose another location to write to (one of the user folders)? Michael I expect this will bite me a lot on vista, but it works on xp. Can some one point me in the right direction with regards to user permissions etc? Thanks -- http://www.ironpythoninaction.com/ http://www.voidspace.org.uk/blog READ CAREFULLY. By accepting and reading this email you agree, on behalf of your employer, to release me from all obligations and waivers arising from any and all NON-NEGOTIATED agreements, licenses, terms-of-service, shrinkwrap, clickwrap, browsewrap, confidentiality, non-disclosure, non-compete and acceptable use policies (”BOGUS AGREEMENTS”) that I have entered into with your employer, its partners, licensors, agents and assigns, in perpetuity, without prejudice to my ongoing rights and privileges. You further represent that you have the authority to release me from any BOGUS AGREEMENTS on behalf of your employer. ___ Users mailing list Users@lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com
Re: [IronPython] GUI programming / IronPython
On 08/07/2010 17:38, Marcin Krol wrote: Hello everyone, I'm a relatively long-time Python user and need to develop a GUI application with Python. I'm waffling between PyQT and IronPython. PyQT has multiplatform capability that is going for it. On the plus side, IronPython may be better integrated with Windows, which will be my main target audience. The question is, how hard is GUI programming with IronPython? Asking bc I have very little experience with C# / .NET. Are there any pitfalls re IronPython / Windows Forms? Is it hard for a newbie to figure out using .NET stuff via IronPython? IronPython and either WPF or Windows Forms is a great platform for developing desktop applications for Windows. It's a fairly big topic. I'd say Windows Forms is probably easier to start with but WPF is capable of creating better looking user interfaces. IronPython in Action has great material on both winforms and WPF, naturally. :-) All the best, Michael Foord -- http://www.ironpythoninaction.com/ http://www.voidspace.org.uk/blog READ CAREFULLY. By accepting and reading this email you agree, on behalf of your employer, to release me from all obligations and waivers arising from any and all NON-NEGOTIATED agreements, licenses, terms-of-service, shrinkwrap, clickwrap, browsewrap, confidentiality, non-disclosure, non-compete and acceptable use policies (”BOGUS AGREEMENTS”) that I have entered into with your employer, its partners, licensors, agents and assigns, in perpetuity, without prejudice to my ongoing rights and privileges. You further represent that you have the authority to release me from any BOGUS AGREEMENTS on behalf of your employer. ___ Users mailing list Users@lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com
Re: [IronPython] Packaging IronPython GUI app
On 08/07/2010 17:38, Marcin Krol wrote: Hello everyone, Is it possible to package IronPython GUI app as standalone executable? Anybody here doing that as a practice for production apps? My motivation is obvious: I can't expect most users to go through rigmarole of installing ironpython to use my app. I need to use standard windows installer, and make an app as robust and self- reliant (in the sense: independent of various system settings and problems) as possible. It seems that it's at least theoretically possible: http://www.codeproject.com/KB/dotnet/ironpython.aspx Caveats? Problems? I'd appreciate feedback from someone who has been there and done that. Packaging an app as an installer is a separate problem from IronPython. I've used Wix in the past for creating installers for Windows. You can use the Pyc compiler to create an executable from your IronPython application, or write a minimal C# .exe that embeds the IronPython engine and starts the app. Both ways are pretty easy. All you need to do is include the IronPython assemblies along with your app. All the best, Michael Foord -- http://www.ironpythoninaction.com/ http://www.voidspace.org.uk/blog READ CAREFULLY. By accepting and reading this email you agree, on behalf of your employer, to release me from all obligations and waivers arising from any and all NON-NEGOTIATED agreements, licenses, terms-of-service, shrinkwrap, clickwrap, browsewrap, confidentiality, non-disclosure, non-compete and acceptable use policies (”BOGUS AGREEMENTS”) that I have entered into with your employer, its partners, licensors, agents and assigns, in perpetuity, without prejudice to my ongoing rights and privileges. You further represent that you have the authority to release me from any BOGUS AGREEMENTS on behalf of your employer. ___ Users mailing list Users@lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com
Re: [IronPython] Dynamic-ish programming, or MissingMemberException
On 08/07/2010 19:03, Marcin Krol wrote: Hello everyone, When I try to add attributes to self in a method outside __init__, I'm getting MissingMemberException. Do I have to add everything to __slots__ and __init__() ? I'm not saying it's not worth having smth like this to get Python plug into CLR, but this is kinda weird. In addition, IronPython Studio crashed when I tried to get an online explanation from the exception window. Don't use IronPython Studio - it is *very* unstable and uses IronPython 1 which is years out of date. Use IronPython Tools for Visual Studio 2010: http://ironpython.net/ironpython/tools/ Basically you shouldn't use __slots__ because it causes problems like this... I think IronPython Studio creates classes with __slots__ when you use the windows forms designer. IronPython Tools doesn't have a winforms designer because it isn't really possible without horrible hacks. I recommend using the Visual Studio C# designer and then subclass the classes it generates from IronPython. Michael -- http://www.ironpythoninaction.com/ http://www.voidspace.org.uk/blog READ CAREFULLY. By accepting and reading this email you agree, on behalf of your employer, to release me from all obligations and waivers arising from any and all NON-NEGOTIATED agreements, licenses, terms-of-service, shrinkwrap, clickwrap, browsewrap, confidentiality, non-disclosure, non-compete and acceptable use policies (”BOGUS AGREEMENTS”) that I have entered into with your employer, its partners, licensors, agents and assigns, in perpetuity, without prejudice to my ongoing rights and privileges. You further represent that you have the authority to release me from any BOGUS AGREEMENTS on behalf of your employer. ___ Users mailing list Users@lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com
Re: [IronPython] Dynamic-ish programming, or MissingMemberException
On 08/07/2010 19:26, Marcin Krol wrote: [snip...] IronPython Tools doesn't have a winforms designer because it isn't really possible without horrible hacks. I recommend using the Visual Studio C# designer and then subclass the classes it generates from IronPython. Thanks, this saves me newbie pains - but can I make this work with VS 2010 Express? Yes - just compile assemblies from the VS 2010 C# Express winforms designer. Add references to those assemblies and import from them in IronPython as you would for any .NET assembly. Michael -- http://www.ironpythoninaction.com/ http://www.voidspace.org.uk/blog READ CAREFULLY. By accepting and reading this email you agree, on behalf of your employer, to release me from all obligations and waivers arising from any and all NON-NEGOTIATED agreements, licenses, terms-of-service, shrinkwrap, clickwrap, browsewrap, confidentiality, non-disclosure, non-compete and acceptable use policies (”BOGUS AGREEMENTS”) that I have entered into with your employer, its partners, licensors, agents and assigns, in perpetuity, without prejudice to my ongoing rights and privileges. You further represent that you have the authority to release me from any BOGUS AGREEMENTS on behalf of your employer. ___ Users mailing list Users@lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com
Re: [IronPython] Write permissions
On 08/07/2010 19:46, Rob Brown-Bayliss wrote: On Thu, Jul 8, 2010 at 11:38 PM, Michael Foord fuzzy...@voidspace.org.uk wrote: Writing to C: in Vista and Windows 7 requires elevated permissions so your application will require admin privileges. Can you not choose another location to write to (one of the user folders)? I could. On linux I would write to /tmp is there a similar concept in windows vista and 7? There are multiple ways of finding the temporary directory in .NET. Are there some good docs along the lines of .NET python equivalents of win32api.GetUserName() and others? System.Environment.UserName System.Environment almost certainly has the temp directory as well. Check that or System.IO.Directory. All the best, Michael -- http://www.ironpythoninaction.com/ http://www.voidspace.org.uk/blog READ CAREFULLY. By accepting and reading this email you agree, on behalf of your employer, to release me from all obligations and waivers arising from any and all NON-NEGOTIATED agreements, licenses, terms-of-service, shrinkwrap, clickwrap, browsewrap, confidentiality, non-disclosure, non-compete and acceptable use policies (BOGUS AGREEMENTS) that I have entered into with your employer, its partners, licensors, agents and assigns, in perpetuity, without prejudice to my ongoing rights and privileges. You further represent that you have the authority to release me from any BOGUS AGREEMENTS on behalf of your employer. ___ Users mailing list Users@lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com
Re: [IronPython] png images in xaml
On 08/07/2010 21:21, Rob Brown-Bayliss wrote: Hi I am using visual studio 2010 and the iron python tools. How do I place an image in a dialog? I have this in my xaml: Image Name=pm_logo Grid.Row='0' Image.Source BitmapImage UriSource=/Images/pm.png/BitmapImage /Image.Source /Image and in the project directory I have the Images folder and the png image. But nothing shows when I run the app. Is it preferable to add the images in code or is xaml the correct place? The URI syntax for loading images from the filesystem is truly horrible and requires you to specify absolute paths I believe. It is easier from C# as you can refer to them statically as embedded resources (or something like that). If I recall correctly, in IronPython in Action I do it by preprocessing the xaml to insert the absolute path in the correct syntax before loading the xaml. Doing it from code is the other alternative. All the best, Michael -- http://www.ironpythoninaction.com/ http://www.voidspace.org.uk/blog READ CAREFULLY. By accepting and reading this email you agree, on behalf of your employer, to release me from all obligations and waivers arising from any and all NON-NEGOTIATED agreements, licenses, terms-of-service, shrinkwrap, clickwrap, browsewrap, confidentiality, non-disclosure, non-compete and acceptable use policies (”BOGUS AGREEMENTS”) that I have entered into with your employer, its partners, licensors, agents and assigns, in perpetuity, without prejudice to my ongoing rights and privileges. You further represent that you have the authority to release me from any BOGUS AGREEMENTS on behalf of your employer. ___ Users mailing list Users@lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com
Re: [IronPython] Foolproof IP Embedding
On 08/07/2010 22:34, Alex wrote: Hello In my WPF application, I want to have an expert mode that lets the end-user write inline python code targetting one specific control (a sheetmusic). I embed IronPython and when the user code throws an exception I catch it and display it but there are a few foolproof problems: 1) If the user write some bad code in a function and binds it to one of the control event, it will crash the whole app. Of course I can recommand my users to always wrap event handlers into a try catch block (or ask to use a decorator that do it) but it's not really foolproof. I want to make it impossible to crash the whole app with user code. Perhaps native events mecanism is a bit too low-level to be foolproof? Catch and report exceptions. 2) If the user code makes an infinite loop it will hang the whole app. I want to have a panic button to stop the script (and even restart the python engine if necessary). I suppose I have to run user code in a worker thread but then the user have to use Invoke mecanisms each time he touchs an UI object? Is there an elegant pattern that deals with this concerns? Execute the user code on a background thread. Provide a means for actions to be invoked on the gui thread (wrapped in exception handling) if necessary. Provide a button to abort the thread if it goes on too long. Michael This questions are more about .NET and patterns than IronPython, but I figured some of you have already thought about it in your IP experience. Thanks for any advices! Alex ___ Users mailing list Users@lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com -- http://www.ironpythoninaction.com/ http://www.voidspace.org.uk/blog READ CAREFULLY. By accepting and reading this email you agree, on behalf of your employer, to release me from all obligations and waivers arising from any and all NON-NEGOTIATED agreements, licenses, terms-of-service, shrinkwrap, clickwrap, browsewrap, confidentiality, non-disclosure, non-compete and acceptable use policies (BOGUS AGREEMENTS) that I have entered into with your employer, its partners, licensors, agents and assigns, in perpetuity, without prejudice to my ongoing rights and privileges. You further represent that you have the authority to release me from any BOGUS AGREEMENTS on behalf of your employer. ___ Users mailing list Users@lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com
Re: [IronPython] IronPython/Silverlight -- callback problem
On 06/07/2010 15:59, Jan-Philip Gehrcke wrote: Hello, I don't know if this is more an IronPython (2.6.1) issue than a Silverlight (4) issue, but I hope that I am talking to the right audience again (thank you for the great answers last time). I've created an `Image` class managing images based on System.Windows.Media.Imaging.BitmapImage. My method `image_instance.load_and_show()` should load the image from a given URI and then show it in an XAML image / element. The important thing is that the showing part should only happen after it is sure that the image has loaded correctly. To control this, I use the BitmapImage.ImageOpened event. This is the relevant part of the code from my `Image` class: def load_and_show(self): self.bi = BitmapImage(Uri(self.abspath, UriKind.Absolute)) self.bi.ImageOpened += self.successfully_loaded_now_show self.bi.ImageFailed += self.load_failed #self.xaml_main_image.Source = self.bi # LINE A def successfully_loaded_now_show(self, s, e): debug(image loaded: %s % s.UriSource) # LINE B self.xaml_main_image.Source = self.bi # LINE C def load_failed(self, s, e): debug(image load failed) # LINE D If the code is like shown above and I do `image_instance.show_and_load()`, nothing happens. More exactly, LINE B, C, and D are not reached. It is like *neither the event ImageOpened nor ImageFailed is toggled*. It seems likely then that the image is not opened or downloaded until you set it as the source on an image. Does the code behave differently if you write it in C#? If you set the bitmapimage as the image source does the event then fire correctly? If so perhaps create the image control but only add it to the visual tree once the bitmap has loaded. Michael If I re-activate (or un-outcomment =)) LINE A, the callbacks magically work properly, i.e. after calling `image_instance.show_and_load()` the image shows up in the UI (either via LINE A or C), and LINE B is definitely reached (or LINE D in case of a wrong URI). The point is that I don't want LINE A, because showing the image should happen in a more controlled manner. What's the problem in my approach, why are the callbacks not called? Thank you in advance, Jan-Philip Gehrcke -- http://gehrcke.de ___ Users mailing list Users@lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com -- http://www.ironpythoninaction.com/ http://www.voidspace.org.uk/blog READ CAREFULLY. By accepting and reading this email you agree, on behalf of your employer, to release me from all obligations and waivers arising from any and all NON-NEGOTIATED agreements, licenses, terms-of-service, shrinkwrap, clickwrap, browsewrap, confidentiality, non-disclosure, non-compete and acceptable use policies (”BOGUS AGREEMENTS”) that I have entered into with your employer, its partners, licensors, agents and assigns, in perpetuity, without prejudice to my ongoing rights and privileges. You further represent that you have the authority to release me from any BOGUS AGREEMENTS on behalf of your employer. ___ Users mailing list Users@lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com
Re: [IronPython] IronPython Tools for existing project
On 07/07/2010 22:18, Dino Viehland wrote: Michael wrote: A further problem I forgot to mention is that when I add / create items through the ui it puts absolute paths in the project file rather than relative ones. This makes it problematic to keep the project files under version control where different users will have different paths. When I edit these paths to make them relative to the solution file / project file everything seems to work - so I can create a tool to fix the project files I guess. Hi Michael, I just wanted to let you know I have a fix for this and it'll be included in the next release. Great! Michael ___ Users mailing list Users@lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com -- http://www.ironpythoninaction.com/ http://www.voidspace.org.uk/blog READ CAREFULLY. By accepting and reading this email you agree, on behalf of your employer, to release me from all obligations and waivers arising from any and all NON-NEGOTIATED agreements, licenses, terms-of-service, shrinkwrap, clickwrap, browsewrap, confidentiality, non-disclosure, non-compete and acceptable use policies (”BOGUS AGREEMENTS”) that I have entered into with your employer, its partners, licensors, agents and assigns, in perpetuity, without prejudice to my ongoing rights and privileges. You further represent that you have the authority to release me from any BOGUS AGREEMENTS on behalf of your employer. ___ Users mailing list Users@lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com
Re: [IronPython] Better NumPy/SciPy Support for IronPython
On 02/07/2010 21:52, Dave Fugate wrote: *From:* users-boun...@lists.ironpython.com [users-boun...@lists.ironpython.com] on behalf of Michael Foord [fuzzy...@voidspace.org.uk] *Sent:* Thursday, July 01, 2010 2:44 PM *To:* Discussion of IronPython *Subject:* Re: [IronPython] Better NumPy/SciPy Support for IronPython On 01/07/2010 20:14, Dave Fugate wrote: Enthought http://www.enthought.com/, a company specialized in Python-based scientific computing solutions, announced http://www.enthought.com/media/SciPyNumPyDotNet.pdf a partnership with Microsoft several hours ago at the SciPy 2010 https://conference.scipy.org/scipy2010/index.html conference in which they’re porting over the NumPy and SciPy http://www.scipy.org/ scientific software packages to IronPython. A significant part of this effort involves duplicating these packages’ C-based modules in .NET. Previously, these libraries could only be consumed from IronPython very slowly using a C to .NET bridge. Is there any evidence (metrics) that using the Ironclad C to .NET bridge is very slow? I can believe there are places where it is slower but but I've never seen enthought (or any one else) show metrics of this. Michael Hi Michael, I personally haven’t seen the performance reports on IronClad, just word of mouth (e.g., http://www.johndcook.com/blog/2009/03/19/ironclad-ironpytho/). Well that is William being typically self-effacing. :-) In practise most of the examples I've seen have been pretty damn fast, and that article points that out too. Going from in pathological cases it’s worse to only be consumed from IronPython very slowly is quite a stretch. Anyway, it's a serious point. It's a shame that the exciting news is being promoted by knocking Ironclad instead of celebrating it. There is another article that takes a similar tack, so I think this was part of the presentation announcing it which is very disappointing. All the best, Michael Dave Not only will this porting effort drastically improve the performance of Python’s top scientific packages under IronPython, it’s fantastic for NumPy/SciPy in the sense that it enables an entirely new community of (.NET) developers to utilize and contribute to these libraries. Also, Enthought’s refactoring work will make it easier to run these packages against all implementations of Python, not just IronPython. It’s expected that NumPy will be finished by September and SciPy before the end of the year. The IronPython Team ___ Users mailing list Users@lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com -- http://www.ironpythoninaction.com/ http://www.voidspace.org.uk/blog READ CAREFULLY. By accepting and reading this email you agree, on behalf of your employer, to release me from all obligations and waivers arising from any and all NON-NEGOTIATED agreements, licenses, terms-of-service, shrinkwrap, clickwrap, browsewrap, confidentiality, non-disclosure, non-compete and acceptable use policies (”BOGUS AGREEMENTS”) that I have entered into with your employer, its partners, licensors, agents and assigns, in perpetuity, without prejudice to my ongoing rights and privileges. You further represent that you have the authority to release me from any BOGUS AGREEMENTS on behalf of your employer. ___ Users mailing list Users@lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com -- http://www.ironpythoninaction.com/ http://www.voidspace.org.uk/blog READ CAREFULLY. By accepting and reading this email you agree, on behalf of your employer, to release me from all obligations and waivers arising from any and all NON-NEGOTIATED agreements, licenses, terms-of-service, shrinkwrap, clickwrap, browsewrap, confidentiality, non-disclosure, non-compete and acceptable use policies (”BOGUS AGREEMENTS”) that I have entered into with your employer, its partners, licensors, agents and assigns, in perpetuity, without prejudice to my ongoing rights and privileges. You further represent that you have the authority to release me from any BOGUS AGREEMENTS on behalf of your employer. ___ Users mailing list Users@lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com
Re: [IronPython] IronPython Tools for existing project
Thanks Jimmy - that answers all my questions. I would *personally* prefer a directory based solution (*much*) with include / exclude regexen but I think our developers will be happy with a VS like solution and I can manipulate the xml to update the project with new files. The Chiron problem is a real problem for us and negates some of the advantage of using Visual Studio. When there is any news on it please let us know. Also please let me know when there is news on informing the Silverlight xaml designer about referenced assemblies. All the best, Michael Foord On 06/07/2010 23:29, Jimmy Schementi wrote: On Mon, Jul 5, 2010 at 7:38 AM, Michael Foord mich...@voidspace.org.uk mailto:mich...@voidspace.org.uk wrote: Hello all, I'm working with a team on an IronPython Silverlight application. Some of the team develop with Windows and would like to use IronPython Tools for Visual Studio, especially for its debugging capabilities. This means I need to create a Visual Studio Solution and project(s) from the existing file layout. We would like to have the project checked in under version control and I'm aware that we'll probably need to manually manipulate the project files when we add files outside of visual studio. I can create the Visual Studio solution and project file and then manually manipulate the xml to add all the folders and individual files. So far so good. (Although perhaps not ideal having to add files individually - unfortunately I was away during the discussion about whether projects should be able to operate from the filesystem or have to explicitly include files.) Yes, projects now have an explicit set of files which VS never magically updates. Unfortunately Show All Files isn't supported on IronPython projects today (well, really MPFProj http://mpfproj.codeplex.com/ doesn't support it), meaning there is no add this sub-directory option, so it's really annoying to add a new set of files. Which means a script to update the pyproj file is your best bet. Dino and I were discussing a refresh button to enable on-demand updating, but that kinda sucks for someone who just wants a directory browser, which is sounds like you'd prefer? Personally I like the directory browser + regex exclusion list, but I understand that others want a closer-to-VS experience. Maybe there should be a toggle on the project that will put it in one or the other modes? I say a project-setting because it wouldn't be good if a explicit-project user created a project, and then it was opened by a directory-browser user. =P Next I want to be able to launch our silverlight app from within visual studio in order to be able to debug. The html file is in a folder call devcode. This has a subdirectory called python, which becomes python.xap when served from chiron. I set the startup file for the project to devcode\index.html and the start directory to devcode. When I launch the app with debugging from Visual Studio I get the message that Chiron has started on port 1322 and IE opens to the page http://localhost:1322/index.html Our html page opens (so far so good again), but unfortunately fails with the following error: Line: 31 Error: Unhandled Error in Silverlight 2 Application Code: 2104 Category: InitializeError Message: Could not download the Silverlight application. Check web server settings So it looks like Chiron is not building python.xap. How can I fix this? I'm able to reproduce this too; all xap file requests are 500 errors. Must be an issue with how VS is launching Chiron, as it works when I launch Chiron with the same set of flags from cmd.exe. Let me poke around a bit more ... The next problem is that the xaml designer doesn't work. It fails due to all the external assembly references used in our xaml. Now this itself isn't so much a problem as I know the xaml designer is ropey at the moment anyway - however Chiron is going to have the same problem. It needs to know which assemblies our app uses so that it can serve them (they are served externally rather than being included in the xap file and need an entry in the Chiron manifest.) No need for putting an entry in the Chiron manifest; just create your own AppManifest.xaml in the python directory and put your entries there. Then put your assemblies somewhere relative to the python directory (like, maybe, bin?), and use the same relative paths in the AppManifest.xaml, like this: ExternalPart Source=bin/foo.zip / If this is never going to work with VS tools I can move the assemblies into the xap file as we will *probably* need this later anyway in order to allow our application to be installed and run out of browser. True, in SL3 ExternalParts did not work OOB, and I don't think that's changed in SL4. However I had assumed I
[IronPython] IronPython Tools for existing project
Hello all, I'm working with a team on an IronPython Silverlight application. Some of the team develop with Windows and would like to use IronPython Tools for Visual Studio, especially for its debugging capabilities. This means I need to create a Visual Studio Solution and project(s) from the existing file layout. We would like to have the project checked in under version control and I'm aware that we'll probably need to manually manipulate the project files when we add files outside of visual studio. I can create the Visual Studio solution and project file and then manually manipulate the xml to add all the folders and individual files. So far so good. (Although perhaps not ideal having to add files individually - unfortunately I was away during the discussion about whether projects should be able to operate from the filesystem or have to explicitly include files.) Next I want to be able to launch our silverlight app from within visual studio in order to be able to debug. The html file is in a folder call devcode. This has a subdirectory called python, which becomes python.xap when served from chiron. I set the startup file for the project to devcode\index.html and the start directory to devcode. When I launch the app with debugging from Visual Studio I get the message that Chiron has started on port 1322 and IE opens to the page http://localhost:1322/index.html Our html page opens (so far so good again), but unfortunately fails with the following error: Line: 31 Error: Unhandled Error in Silverlight 2 Application Code: 2104 Category: InitializeError Message: Could not download the Silverlight application. Check web server settings So it looks like Chiron is not building python.xap. How can I fix this? The next problem is that the xaml designer doesn't work. It fails due to all the external assembly references used in our xaml. Now this itself isn't so much a problem as I know the xaml designer is ropey at the moment anyway - however Chiron is going to have the same problem. It needs to know which assemblies our app uses so that it can serve them (they are served externally rather than being included in the xap file and need an entry in the Chiron manifest.) If this is never going to work with VS tools I can move the assemblies into the xap file as we will *probably* need this later anyway in order to allow our application to be installed and run out of browser. However I had assumed I could add a reference to the assemblies we were using. The add reference dialog doesn't actually allow me to add any references... The only active button on it is Cancel. Is it possible to add references to Silverlight assemblies used by our project? (And preferably have them picked up by both the xaml designer and by chiron.) All the best, Michael -- http://www.ironpythoninaction.com/ http://www.voidspace.org.uk/blog READ CAREFULLY. By accepting and reading this email you agree, on behalf of your employer, to release me from all obligations and waivers arising from any and all NON-NEGOTIATED agreements, licenses, terms-of-service, shrinkwrap, clickwrap, browsewrap, confidentiality, non-disclosure, non-compete and acceptable use policies (”BOGUS AGREEMENTS”) that I have entered into with your employer, its partners, licensors, agents and assigns, in perpetuity, without prejudice to my ongoing rights and privileges. You further represent that you have the authority to release me from any BOGUS AGREEMENTS on behalf of your employer. ___ Users mailing list Users@lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com
Re: [IronPython] IronPython Tools for existing project
Hello all, A further problem I forgot to mention is that when I add / create items through the ui it puts absolute paths in the project file rather than relative ones. This makes it problematic to keep the project files under version control where different users will have different paths. When I edit these paths to make them relative to the solution file / project file everything seems to work - so I can create a tool to fix the project files I guess. All the best, Michael Foord On 05/07/2010 15:38, Michael Foord wrote: Hello all, I'm working with a team on an IronPython Silverlight application. Some of the team develop with Windows and would like to use IronPython Tools for Visual Studio, especially for its debugging capabilities. This means I need to create a Visual Studio Solution and project(s) from the existing file layout. We would like to have the project checked in under version control and I'm aware that we'll probably need to manually manipulate the project files when we add files outside of visual studio. I can create the Visual Studio solution and project file and then manually manipulate the xml to add all the folders and individual files. So far so good. (Although perhaps not ideal having to add files individually - unfortunately I was away during the discussion about whether projects should be able to operate from the filesystem or have to explicitly include files.) Next I want to be able to launch our silverlight app from within visual studio in order to be able to debug. The html file is in a folder call devcode. This has a subdirectory called python, which becomes python.xap when served from chiron. I set the startup file for the project to devcode\index.html and the start directory to devcode. When I launch the app with debugging from Visual Studio I get the message that Chiron has started on port 1322 and IE opens to the page http://localhost:1322/index.html Our html page opens (so far so good again), but unfortunately fails with the following error: Line: 31 Error: Unhandled Error in Silverlight 2 Application Code: 2104 Category: InitializeError Message: Could not download the Silverlight application. Check web server settings So it looks like Chiron is not building python.xap. How can I fix this? The next problem is that the xaml designer doesn't work. It fails due to all the external assembly references used in our xaml. Now this itself isn't so much a problem as I know the xaml designer is ropey at the moment anyway - however Chiron is going to have the same problem. It needs to know which assemblies our app uses so that it can serve them (they are served externally rather than being included in the xap file and need an entry in the Chiron manifest.) If this is never going to work with VS tools I can move the assemblies into the xap file as we will *probably* need this later anyway in order to allow our application to be installed and run out of browser. However I had assumed I could add a reference to the assemblies we were using. The add reference dialog doesn't actually allow me to add any references... The only active button on it is Cancel. Is it possible to add references to Silverlight assemblies used by our project? (And preferably have them picked up by both the xaml designer and by chiron.) All the best, Michael -- http://www.ironpythoninaction.com/ http://www.voidspace.org.uk/blog READ CAREFULLY. By accepting and reading this email you agree, on behalf of your employer, to release me from all obligations and waivers arising from any and all NON-NEGOTIATED agreements, licenses, terms-of-service, shrinkwrap, clickwrap, browsewrap, confidentiality, non-disclosure, non-compete and acceptable use policies (”BOGUS AGREEMENTS”) that I have entered into with your employer, its partners, licensors, agents and assigns, in perpetuity, without prejudice to my ongoing rights and privileges. You further represent that you have the authority to release me from any BOGUS AGREEMENTS on behalf of your employer. ___ Users mailing list Users@lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com
Re: [IronPython] IronPython Tools for existing project
On 05/07/2010 21:20, Dino Viehland wrote: We should definitely be adding relative paths so this is just a bug and I'll take a look at fixing it. Cool - any ideas on the Chiron issue? (Why it isn't building our xap file and if it is possible for me to tell it about the external assemblies it needs to serve.) All the best, Michael -Original Message- From: users-boun...@lists.ironpython.com [mailto:users- boun...@lists.ironpython.com] On Behalf Of Michael Foord Sent: Monday, July 05, 2010 8:12 AM To: Discussion of IronPython Cc: Sven Passig Subject: Re: [IronPython] IronPython Tools for existing project Hello all, A further problem I forgot to mention is that when I add / create items through the ui it puts absolute paths in the project file rather than relative ones. This makes it problematic to keep the project files under version control where different users will have different paths. When I edit these paths to make them relative to the solution file / project file everything seems to work - so I can create a tool to fix the project files I guess. All the best, Michael Foord On 05/07/2010 15:38, Michael Foord wrote: Hello all, I'm working with a team on an IronPython Silverlight application. Some of the team develop with Windows and would like to use IronPython Tools for Visual Studio, especially for its debugging capabilities. This means I need to create a Visual Studio Solution and project(s) from the existing file layout. We would like to have the project checked in under version control and I'm aware that we'll probably need to manually manipulate the project files when we add files outside of visual studio. I can create the Visual Studio solution and project file and then manually manipulate the xml to add all the folders and individual files. So far so good. (Although perhaps not ideal having to add files individually - unfortunately I was away during the discussion about whether projects should be able to operate from the filesystem or have to explicitly include files.) Next I want to be able to launch our silverlight app from within visual studio in order to be able to debug. The html file is in a folder call devcode. This has a subdirectory called python, which becomes python.xap when served from chiron. I set the startup file for the project to devcode\index.html and the start directory to devcode. When I launch the app with debugging from Visual Studio I get the message that Chiron has started on port 1322 and IE opens to the page http://localhost:1322/index.html Our html page opens (so far so good again), but unfortunately fails with the following error: Line: 31 Error: Unhandled Error in Silverlight 2 Application Code: 2104 Category: InitializeError Message: Could not download the Silverlight application. Check web server settings So it looks like Chiron is not building python.xap. How can I fix this? The next problem is that the xaml designer doesn't work. It fails due to all the external assembly references used in our xaml. Now this itself isn't so much a problem as I know the xaml designer is ropey at the moment anyway - however Chiron is going to have the same problem. It needs to know which assemblies our app uses so that it can serve them (they are served externally rather than being included in the xap file and need an entry in the Chiron manifest.) If this is never going to work with VS tools I can move the assemblies into the xap file as we will *probably* need this later anyway in order to allow our application to be installed and run out of browser. However I had assumed I could add a reference to the assemblies we were using. The add reference dialog doesn't actually allow me to add any references... The only active button on it is Cancel. Is it possible to add references to Silverlight assemblies used by our project? (And preferably have them picked up by both the xaml designer and by chiron.) All the best, Michael -- http://www.ironpythoninaction.com/ http://www.voidspace.org.uk/blog READ CAREFULLY. By accepting and reading this email you agree, on behalf of your employer, to release me from all obligations and waivers arising from any and all NON-NEGOTIATED agreements, licenses, terms-of- service, shrinkwrap, clickwrap, browsewrap, confidentiality, non- disclosure, non-compete and acceptable use policies (BOGUS AGREEMENTS) that I have entered into with your employer, its partners, licensors, agents and assigns, in perpetuity, without prejudice to my ongoing rights and privileges. You further represent that you have the authority to release me from any BOGUS AGREEMENTS on behalf of your employer. ___ Users mailing list Users@lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users
Re: [IronPython] IronPython Tools for existing project
On 05/07/2010 21:27, Jimmy Schementi wrote: On Mon, Jul 5, 2010 at 1:22 PM, Michael Foord fuzzy...@voidspace.org.uk mailto:fuzzy...@voidspace.org.uk wrote: On 05/07/2010 21:20, Dino Viehland wrote: We should definitely be adding relative paths so this is just a bug and I'll take a look at fixing it. Cool - any ideas on the Chiron issue? (Why it isn't building our xap file and if it is possible for me to tell it about the external assemblies it needs to serve.) I'll look into it tomorrow Thanks guys - really appreciate your help. All the best, Michael All the best, Michael -Original Message- From: users-boun...@lists.ironpython.com mailto:users-boun...@lists.ironpython.com [mailto:users- mailto:users- boun...@lists.ironpython.com mailto:boun...@lists.ironpython.com] On Behalf Of Michael Foord Sent: Monday, July 05, 2010 8:12 AM To: Discussion of IronPython Cc: Sven Passig Subject: Re: [IronPython] IronPython Tools for existing project Hello all, A further problem I forgot to mention is that when I add / create items through the ui it puts absolute paths in the project file rather than relative ones. This makes it problematic to keep the project files under version control where different users will have different paths. When I edit these paths to make them relative to the solution file / project file everything seems to work - so I can create a tool to fix the project files I guess. All the best, Michael Foord On 05/07/2010 15:38, Michael Foord wrote: Hello all, I'm working with a team on an IronPython Silverlight application. Some of the team develop with Windows and would like to use IronPython Tools for Visual Studio, especially for its debugging capabilities. This means I need to create a Visual Studio Solution and project(s) from the existing file layout. We would like to have the project checked in under version control and I'm aware that we'll probably need to manually manipulate the project files when we add files outside of visual studio. I can create the Visual Studio solution and project file and then manually manipulate the xml to add all the folders and individual files. So far so good. (Although perhaps not ideal having to add files individually - unfortunately I was away during the discussion about whether projects should be able to operate from the filesystem or have to explicitly include files.) Next I want to be able to launch our silverlight app from within visual studio in order to be able to debug. The html file is in a folder call devcode. This has a subdirectory called python, which becomes python.xap when served from chiron. I set the startup file for the project to devcode\index.html and the start directory to devcode. When I launch the app with debugging from Visual Studio I get the message that Chiron has started on port 1322 and IE opens to the page http://localhost:1322/index.html Our html page opens (so far so good again), but unfortunately fails with the following error: Line: 31 Error: Unhandled Error in Silverlight 2 Application Code: 2104 Category: InitializeError Message: Could not download the Silverlight application. Check web server settings So it looks like Chiron is not building python.xap. How can I fix this? The next problem is that the xaml designer doesn't work. It fails due to all the external assembly references used in our xaml. Now this itself isn't so much a problem as I know the xaml designer is ropey at the moment anyway - however Chiron is going to have
Re: [IronPython] Developing Silverlight apps using IronPython -- best strategies
On 02/07/2010 19:34, Jimmy Schementi wrote: [snip...] 1) What is the cutting-edge way to deploy an SL4/IP2.6 application? I've basically seen two: - The all-in-xap-way, with the python application and assemblies as well as the XAML in the xap file, as it is described in the article series at http://www.voidspace.org.uk/ironpython/silverlight/silverlight_application.s html - The Gestalt way, with some magic inside, allowing to place XAML/Python code directly in the HTML Is the first way out-of-date? Are there more techniques? What are advantages/disadvantages? There are two ways of developing apps because the Silverlight application model and the HTML application model are way different. The all-in-xap-way doesn't fight Silverlight at all, but it is a fight against how you're use to making web-apps. The script-tag way doesn't fight the web at all, but requires some tricks to work in Silverlight's world (zip files for DLL's, for example). We now advertise the script-tag way, as its most friendly to how people develop in dynamic languages, but there is nothing obsolete about the all-in-xap way. I personally prefer the script-tag way, and then I put libraries in zip files as needed. However, if you want to make a Silverlight app which runs out-of-browser, you need to use the app-in-xap way, since there in no HTML page to put script-tags on. =) The Gestalt way is definitely the cutting edge, and was brought in after I wrote the silverlight articles. It is on my list to update these articles... [snip good questions and good answers from Jimmy that I can't add to...] 4) Code compilation: Is it possible to develop using IP, but to only deploy compiled binaries? I've stumbled over Pyc. How to use it within the best approach of question (1)? My naive mind sees two possible advantages: - Could this be a solution to the traffic problem in question (2), i.e. would this do without IP assembly provisioning? - For some developers it could be attractive for code obfuscation. I have the feeling that things are not that easy... We don't support pre-compilation in Silverlight today. It wouldn't solve the traffic problem, as the DLR and IronPython are still required to run the pyc files. It might help make startup a bit quicker, but we haven't done performance testing to see what the actual win would be in Silverlight. In practice I prefer to import on a background thread, which does not hang the app during startup, and lets things load in as they need to. We would dearly love to be able to deliver compiled IronPython binaries with Silverlight applications - mainly for startup performance (but also code obfuscation which is always a controversial topic). We also use background thread importing but it is still not as fast as we *would like*... :-) I think the limitation here is in the core-CLR missing the APIs that Pyc uses to write out assemblies. All the best, Michael Foord -- http://www.ironpythoninaction.com/ http://www.voidspace.org.uk/blog READ CAREFULLY. By accepting and reading this email you agree, on behalf of your employer, to release me from all obligations and waivers arising from any and all NON-NEGOTIATED agreements, licenses, terms-of-service, shrinkwrap, clickwrap, browsewrap, confidentiality, non-disclosure, non-compete and acceptable use policies (”BOGUS AGREEMENTS”) that I have entered into with your employer, its partners, licensors, agents and assigns, in perpetuity, without prejudice to my ongoing rights and privileges. You further represent that you have the authority to release me from any BOGUS AGREEMENTS on behalf of your employer. ___ Users mailing list Users@lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com
Re: [IronPython] Announcing IronPython Tools for Visual Studio CTP3
On 02/07/2010 00:35, Jimmy Schementi wrote: Keep in mind, these downloads are hosted on the website directly only while we have this temporary license; once the source code is released as well, the downloads will move to CodePlex. Right, but the changes I were suggesting were really simple ones no? That being said, the download page which redirects to the actual file is for tracking purposes; we use Google Analytics to track downloads, and have no way of tracking files that way. Don't you have server logs? (Or are you counting page views as downloads? Given that IE blocks the download by default, and you have to manually allow it, you will get some nicely inflated figures that way...) It's pretty easy to figure out where the redirect is pulling the file from; hint: http://ironpython.net/tools/version/IronPythonTools.vsix. But the way you find that out is by doing view source on the page after you've downloaded it. Or cancel the download and because there is no download link you have to refresh the page to start it again. If you want to save a versioned filename so you know what version it is you have on your fileystem if you need to reinstall then you have to remember to do this after you have downloaded and rename it yourself. Sending a versioned filename at least would save that. Though, we can't track those downloads, and those stats are one of the ways we show Microsoft management the benefits of the project. Also, a list of versions will be at http://ironpython.net/tools/download/versions.html. That's helpful. Thanks Michael Foord ~Jimmy *From:* users-boun...@lists.ironpython.com [users-boun...@lists.ironpython.com] on behalf of Michael Foord [fuzzy...@voidspace.org.uk] *Sent:* Thursday, July 01, 2010 2:46 PM *To:* Discussion of IronPython *Subject:* Re: [IronPython] Announcing IronPython Tools for Visual Studio CTP3 On 01/07/2010 19:34, Dino Viehland wrote: Hello Python Community, We are happy to announce a minor update to the IronPython Tools for Visual Studio. IronPython Tools for Visual Studio (IPyTools) is a set of extensions available for Visual Studio 2010 which supports development of IronPython applications. This release is our 3^rd Community Technical Preview (CTP) and builds upon the previous two releases. The release is a minor update which includes bug fixes and a number of small features. You can download the latest release at http://www.ironpython.net/ironpython/tools/ Can the download page please have a download link on it instead of (or as well as) serving the download through a refresh: http://ironpython.net/tools/download/ Additionally, if possible, can the downloaded file have a version number in the filename please. :-) Thanks Michael Foord There is also one major change in that the project system is no longer based upon the files which live on disk. Instead we now follow the normal VS project model. This means files must be explicitly added to the project and files which you don’t want in the project won’t automatically show up. We made this change based upon feedback from people using the tool and think it will make it more familiar for normal Visual Studio users. Despite this change there is still support for an “implicit” project when working without a project. Like the previous release this release includes support for Intellisense including member completion, signature help, find all references, and goto definition. It enables quick browsing of your code using the object browser and the editor navigation bar. It has an interactive (REPL) window that enables the development of applications in an interactive way. IPyTools supports lightweight development without a project as well as working with project files in the tradition of Visual Studio . Opening a .py file causes IronPython Tools to model the code in the containing directory as an implicit project for Intellisense features. There are project templates for console, WPF, WinForms, and Silverlight applications. WPF applications support drag-and-drop UI development. Debugging of Python applications works just like you debug other languages in Visual Studio. We are still working on our final licensing terms for IronPython Tools, and as such this release is licensed under a temporary limited use license. While we weren’t able to finalize this for this release we expect to have this finalized for the next release. The full list of changes includes a number of bug fixes: Interactive window now respects VS color settings Fixed default settings for insert tabs, enter completing options, list of characters to complete to Fixed auto-indent inserting extra tabs on a blank line Enables usage of VS common settings for smart indentation and tabs and respects those options
Re: [IronPython] Better NumPy/SciPy Support for IronPython
On 01/07/2010 20:14, Dave Fugate wrote: Enthought, a company specialized in Python-based scientific computing solutions, announced a partnership with Microsoft several hours ago at the SciPy 2010 conference in which theyre porting over the NumPy and SciPy scientific software packages to IronPython. A significant part of this effort involves duplicating these packages C-based modules in .NET. Previously, these libraries could only be consumed from IronPython very slowly using a C to .NET bridge. Is there any evidence (metrics) that using the Ironclad C to .NET bridge is "very slow"? I can believe there are places where it is slower but but I've never seen enthought (or any one else) show metrics of this. Michael Not only will this porting effort drastically improve the performance of Pythons top scientific packages under IronPython, its fantastic for NumPy/SciPy in the sense that it enables an entirely new community of (.NET) developers to utilize and contribute to these libraries. Also, Enthoughts refactoring work will make it easier to run these packages against all implementations of Python, not just IronPython. Its expected that NumPy will be finished by September and SciPy before the end of the year. The IronPython Team ___ Users mailing list Users@lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com -- http://www.ironpythoninaction.com/ http://www.voidspace.org.uk/blog READ CAREFULLY. By accepting and reading this email you agree, on behalf of your employer, to release me from all obligations and waivers arising from any and all NON-NEGOTIATED agreements, licenses, terms-of-service, shrinkwrap, clickwrap, browsewrap, confidentiality, non-disclosure, non-compete and acceptable use policies (BOGUS AGREEMENTS) that I have entered into with your employer, its partners, licensors, agents and assigns, in perpetuity, without prejudice to my ongoing rights and privileges. You further represent that you have the authority to release me from any BOGUS AGREEMENTS on behalf of your employer. ___ Users mailing list Users@lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com
Re: [IronPython] Announcing IronPython Tools for Visual Studio CTP3
On 01/07/2010 19:34, Dino Viehland wrote: Hello Python Community, We are happy to announce a minor update to the IronPython Tools for Visual Studio. IronPython Tools for Visual Studio (IPyTools) is a set of extensions available for Visual Studio 2010 which supports development of IronPython applications. This release is our 3^rd Community Technical Preview (CTP) and builds upon the previous two releases. The release is a minor update which includes bug fixes and a number of small features. You can download the latest release at http://www.ironpython.net/ironpython/tools/ Can the download page please have a download link on it instead of (or as well as) serving the download through a refresh: http://ironpython.net/tools/download/ Additionally, if possible, can the downloaded file have a version number in the filename please. :-) Thanks Michael Foord There is also one major change in that the project system is no longer based upon the files which live on disk. Instead we now follow the normal VS project model. This means files must be explicitly added to the project and files which you don't want in the project won't automatically show up. We made this change based upon feedback from people using the tool and think it will make it more familiar for normal Visual Studio users. Despite this change there is still support for an implicit project when working without a project. Like the previous release this release includes support for Intellisense including member completion, signature help, find all references, and goto definition. It enables quick browsing of your code using the object browser and the editor navigation bar. It has an interactive (REPL) window that enables the development of applications in an interactive way. IPyTools supports lightweight development without a project as well as working with project files in the tradition of Visual Studio . Opening a .py file causes IronPython Tools to model the code in the containing directory as an implicit project for Intellisense features. There are project templates for console, WPF, WinForms, and Silverlight applications. WPF applications support drag-and-drop UI development. Debugging of Python applications works just like you debug other languages in Visual Studio. We are still working on our final licensing terms for IronPython Tools, and as such this release is licensed under a temporary limited use license. While we weren't able to finalize this for this release we expect to have this finalized for the next release. The full list of changes includes a number of bug fixes: Interactive window now respects VS color settings Fixed default settings for insert tabs, enter completing options, list of characters to complete to Fixed auto-indent inserting extra tabs on a blank line Enables usage of VS common settings for smart indentation and tabs and respects those options. Escape in REPL cancels both the intellisense session and the current input REPL: When a completion item is focused but not selective enter should not complete it REPL: We should respect the various intellisense completion options REPL: We should be using IronPython's auto intending Fix repl not respecting smart up/down on startup if the window was set to be open REPL: Don't allow history if the current command is still running -- instead navigate the buffer REPL: Enable syntax highlighting even if a command throws an exception REPL: Remove trailing new lines from REPL history so we go back to the last line of input REPL: When pasting ensure there's a new line REPL: Auto indent should delete selected lines when pressing enter There are also a few new features: New Fill Comment Paragraph feature Implemented auto-dedent so it will backspace # of tabs Support for disabling intellisense via normal VS mechanism Support for hiding advanced members in intellisense (currently defined as __abc__ members) There is one major change: Removes directory based projects in favor of normal VS style projects - The IronPython Team ___ Users mailing list Users@lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com -- http://www.ironpythoninaction.com/ http://www.voidspace.org.uk/blog READ CAREFULLY. By accepting and reading this email you agree, on behalf of your employer, to release me from all obligations and waivers arising from any and all NON-NEGOTIATED agreements, licenses, terms-of-service, shrinkwrap, clickwrap, browsewrap, confidentiality, non-disclosure, non-compete and acceptable use policies (BOGUS AGREEMENTS) that I have entered into with your employer, its partners, licensors, agents and assigns, in perpetuity, without prejudice to my ongoing rights and privileges
Re: [IronPython] bug when overriding __delattr__
On 23/06/2010 13:38, Ronnie Maor wrote: The following code works in CPython 2.6.2, but is broken in both IPy 2.6 and 2.6.1 class A(object): ... def __delattr__(self,name): ... object.__delattr__(self,name) ... a = A() a.x = 3 del a.x Traceback (most recent call last): File stdin, line 1, in module File stdin, line 3, in __delattr__ AttributeError: 'A' object has no attribute 'x' You are correct, but this has already been reported and is fixed on trunk. The fix will be in 2.6.2 which will hopefully be released soon... :-) All the best, Michael ___ Users mailing list Users@lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com -- http://www.ironpythoninaction.com/ http://www.voidspace.org.uk/blog READ CAREFULLY. By accepting and reading this email you agree, on behalf of your employer, to release me from all obligations and waivers arising from any and all NON-NEGOTIATED agreements, licenses, terms-of-service, shrinkwrap, clickwrap, browsewrap, confidentiality, non-disclosure, non-compete and acceptable use policies (BOGUS AGREEMENTS) that I have entered into with your employer, its partners, licensors, agents and assigns, in perpetuity, without prejudice to my ongoing rights and privileges. You further represent that you have the authority to release me from any BOGUS AGREEMENTS on behalf of your employer. ___ Users mailing list Users@lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com
Re: [IronPython] Problem Closing Application
= System.Windows.Forms.MessageBox if self._txt_Login.Text == test and self._txt_pwd.Text == test: #MsgBox.Show(Welcome to the Wonderful World of Visual Basic) MF = mf() MF.Show() MF.Activate() MF.Select() self.Hide() #MF.SetTopLevel = True else: MsgBox.Show(UserName Or Password Incorrect) #pass def Txt_LoginTextChanged(self, sender, e): pass def Bt_cancelClick(self, sender, e): self.Close() class mf(MainForm.MainForm): pass #conn = sqlite3.connect(rc:\tester.sqlite) #c = conn.cursor() #c.execute(insert into test values (Null,'Bozz11','Crazyman11')) #conn.commit() #c.close() class encrypt_a(object): def EncryptString(self, strEncrypted): b = System.Text.ASCIIEncoding.ASCII.GetBytes(strEncrypted) encryptedConnectionString = System.Convert.ToBase64String(b) return encryptedConnectionString def __init__(self): pass class decrypt_a(object): def DecryptString(self, encrString): b = System.Convert.FromBase64String(encrString) decryptedConnectionString = System.Text.ASCIIEncoding.ASCII.GetString(b) return decryptedConnectionString #ac = Anthony #cc = encrypt_a().EncryptString(ac) #cca = Log_In()._txt_Login.Text = tett *** MainForm.py import System.Drawing import System.Windows.Forms from System.Drawing import * from System.Windows.Forms import * import Log_In class MainForm(Form): def __init__(self): #pass self.InitializeComponent() def InitializeComponent(self): #xx.Close() self._textBox1 = System.Windows.Forms.TextBox() self.SuspendLayout() # # textBox1 # self._textBox1.Location = System.Drawing.Point(129, 101) self._textBox1.Name = textBox1 self._textBox1.Size = System.Drawing.Size(231, 20) self._textBox1.TabIndex = 0 # # MainForm # self.ClientSize = System.Drawing.Size(503, 356) self.Controls.Add(self._textBox1) self.Name = MainForm self.Text = HSE self.Load += self.MainFormLoad self.ResumeLayout(False) #self.PerformLayout() #self.OnFormClosing(Application.Exit()) def MainFormLoad(self, sender, e): pass Hope you can help out with this! On Sun, Jun 13, 2010 at 1:52 AM, Michael Foord fuzzy...@voidspace.org.uk mailto:fuzzy...@voidspace.org.uk wrote: On 12/06/2010 16:22, Anthony wrote: Hi All Just to state - I'm a real newbie to programming ironpython I have an application that has 2 forms. The application gets started in the progam.py module(btw i'm using #develop). This calls another module - login.py. This is a login form which validates user names/passwords. Once this is validated I _hide_ the form and call the second module - MainForm.py. The program runs fine - except that when I close the MainForm form - the application is still running. I know it's because a login.py object is hidden. What I'm asking is how construct the programming in such a way that this does not happen - that when the second form is closed - the application closes; or is there a better way to do this? How about closing the login form instead of hiding it? Another way is to handle the Closing event on your main form and close the login form then. You can also call Application.Exit() (I believe - this is off the top of my head so you should check) to exit the GUI event loop. All the best, Michael Regards Anthony ___ Users mailing list Users@lists.ironpython.com mailto:Users@lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com -- http://www.ironpythoninaction.com/ http://www.voidspace.org.uk/blog READ CAREFULLY. By accepting and reading this email you agree, on behalf of your employer, to release me from all obligations and waivers arising from any and all NON-NEGOTIATED agreements, licenses, terms-of-service, shrinkwrap, clickwrap, browsewrap, confidentiality, non-disclosure, non-compete and acceptable use policies (”BOGUS AGREEMENTS”) that I have entered into with your employer, its partners, licensors, agents and assigns, in perpetuity, without prejudice to my ongoing rights and privileges. You further represent that you have the authority to release me from any BOGUS AGREEMENTS on behalf of your employer. -- http://www.ironpythoninaction.com/ http://www.voidspace.org.uk/blog READ CAREFULLY. By accepting and reading this email you agree, on behalf of your employer, to release me from all obligations and waivers arising from any and all NON-NEGOTIATED agreements
[IronPython] Problem with ScriptSource.GetCodeProperties()
Hello all, IronPython 2.6.1: import clr clr.AddReference('IronPython') clr.AddReference('Microsoft.Scripting') from IronPython.Hosting import Python from Microsoft.Scripting import SourceCodeKind engine = Python.CreateEngine() scope = engine.CreateScope() text = 'lambda' source = engine.CreateScriptSourceFromString(text, 'stdin', SourceCodeKind.InteractiveCode) result = source.GetCodeProperties() Traceback (most recent call last): File stdin, line 1, in module TypeError: Value cannot be null. Parameter name: parameters If instead of 'stdin' I use 'stdin' like I used to it throws for that as well. All the best, Michael Foord -- http://www.ironpythoninaction.com/ http://www.voidspace.org.uk/blog READ CAREFULLY. By accepting and reading this email you agree, on behalf of your employer, to release me from all obligations and waivers arising from any and all NON-NEGOTIATED agreements, licenses, terms-of-service, shrinkwrap, clickwrap, browsewrap, confidentiality, non-disclosure, non-compete and acceptable use policies (”BOGUS AGREEMENTS”) that I have entered into with your employer, its partners, licensors, agents and assigns, in perpetuity, without prejudice to my ongoing rights and privileges. You further represent that you have the authority to release me from any BOGUS AGREEMENTS on behalf of your employer. ___ Users mailing list Users@lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com
Re: [IronPython] Problem Closing Application
On 12/06/2010 16:22, Anthony wrote: Hi All Just to state - I'm a real newbie to programming ironpython I have an application that has 2 forms. The application gets started in the progam.py module(btw i'm using #develop). This calls another module - login.py. This is a login form which validates user names/passwords. Once this is validated I _hide_ the form and call the second module - MainForm.py. The program runs fine - except that when I close the MainForm form - the application is still running. I know it's because a login.py object is hidden. What I'm asking is how construct the programming in such a way that this does not happen - that when the second form is closed - the application closes; or is there a better way to do this? How about closing the login form instead of hiding it? Another way is to handle the Closing event on your main form and close the login form then. You can also call Application.Exit() (I believe - this is off the top of my head so you should check) to exit the GUI event loop. All the best, Michael Regards Anthony ___ Users mailing list Users@lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com -- http://www.ironpythoninaction.com/ http://www.voidspace.org.uk/blog READ CAREFULLY. By accepting and reading this email you agree, on behalf of your employer, to release me from all obligations and waivers arising from any and all NON-NEGOTIATED agreements, licenses, terms-of-service, shrinkwrap, clickwrap, browsewrap, confidentiality, non-disclosure, non-compete and acceptable use policies (BOGUS AGREEMENTS) that I have entered into with your employer, its partners, licensors, agents and assigns, in perpetuity, without prejudice to my ongoing rights and privileges. You further represent that you have the authority to release me from any BOGUS AGREEMENTS on behalf of your employer. ___ Users mailing list Users@lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com
Re: [IronPython] NLTK in C# application?
On 11/06/2010 12:06, William Johnston wrote: Hello, Where is the sys.path file located? If you start the IronPython console and execute import sys, then print sys.path it will show you all the directories it looks when you try to import a module. You can manually add a directory to this path (sys.path.append(r'c:\SomePath')) at the start of your code to add extra locations to your import path. All the best, Michael Thanks. *From:* Michael Foord [mailto:fuzzy...@voidspace.org.uk] *Sent:* Thursday, June 10, 2010 11:29 AM *To:* Discussion of IronPython *Cc:* William Johnston *Subject:* Re: [IronPython] NLTK in C# application? On 10/06/2010 14:57, William Johnston wrote: Hello, In order for NLTK to work, I need to install PyYaml. However, the PyYaml installer does not recognize the IronPython installation in the Registry. How do I alter the registry? I don't know - the folks on the pywin32 mailing list could probably tell you. An easier route would be to install Python, then install PyYaml, then either copy the files to somewhere on sys.path for IronPython (or add your Python site-packages folder to sys.path in your IronPython code). All the best, Michael Foord Thanks. *From:* users-boun...@lists.ironpython.com mailto:users-boun...@lists.ironpython.com [mailto:users-boun...@lists.ironpython.com] *On Behalf Of *Michael Foord *Sent:* Thursday, June 10, 2010 7:11 AM *To:* Discussion of IronPython *Subject:* Re: [IronPython] NLTK in C# application? On 10/06/2010 12:05, William Johnston wrote: Hello, How do I include the NLTK modules in a C# application? There is already code for embedded Python. The first step is to try importing it and running some examples from in IronPython. If that works then you just need to provide a 'bridge' layer that embeds IronPython in your C# app and allows you to call into IronPython to use NLTK. If NLTK *doesn't* work from IronPython it will probably be because it uses C extension modules not available in IronPython. One way round this is to use Ironclad. Again, try some NLTK examples from IronPython but with Ironclad and see if that works. http://www.resolversystems.com/products/ironclad/ If it still doesn't work it may be worth reporting back here with the problems to see if they are resolvable. All the best, Michael Foord Thanks. ___ Users mailing list Users@lists.ironpython.com mailto:Users@lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com -- http://www.ironpythoninaction.com/ http://www.voidspace.org.uk/blog READ CAREFULLY. By accepting and reading this email you agree, on behalf of your employer, to release me from all obligations and waivers arising from any and all NON-NEGOTIATED agreements, licenses, terms-of-service, shrinkwrap, clickwrap, browsewrap, confidentiality, non-disclosure, non-compete and acceptable use policies (BOGUS AGREEMENTS) that I have entered into with your employer, its partners, licensors, agents and assigns, in perpetuity, without prejudice to my ongoing rights and privileges. You further represent that you have the authority to release me from any BOGUS AGREEMENTS on behalf of your employer. ___ Users mailing list Users@lists.ironpython.com mailto:Users@lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com -- http://www.ironpythoninaction.com/ http://www.voidspace.org.uk/blog READ CAREFULLY. By accepting and reading this email you agree, on behalf of your employer, to release me from all obligations and waivers arising from any and all NON-NEGOTIATED agreements, licenses, terms-of-service, shrinkwrap, clickwrap, browsewrap, confidentiality, non-disclosure, non-compete and acceptable use policies (BOGUS AGREEMENTS) that I have entered into with your employer, its partners, licensors, agents and assigns, in perpetuity, without prejudice to my ongoing rights and privileges. You further represent that you have the authority to release me from any BOGUS AGREEMENTS on behalf of your employer. -- http://www.ironpythoninaction.com/ http://www.voidspace.org.uk/blog READ CAREFULLY. By accepting and reading this email you agree, on behalf of your employer, to release me from all obligations and waivers arising from any and all NON-NEGOTIATED agreements, licenses, terms-of-service, shrinkwrap, clickwrap, browsewrap, confidentiality, non-disclosure, non-compete and acceptable use policies (BOGUS AGREEMENTS) that I have entered into with your employer, its partners, licensors, agents and assigns, in perpetuity, without prejudice to my ongoing rights and privileges. You further represent that you have the authority to release me from any BOGUS AGREEMENTS on behalf of your employer. ___ Users mailing list Users
Re: [IronPython] NLTK in C# application?
On 11/06/2010 14:53, William Johnston wrote: Mr. Foord: I apologize for so many questions. But it seems I cannot perform the folllowing statement: import subprocess Which returns No module named subprocess. Could you explain this? I'm afraid there is no subprocess module (yet) for IronPython. Two alternatives are: http://www.ironpython.info/index.php/Launching_Sub-Processes http://www.ironpython.info/index.php/The_subprocess_module All the best, Michael Foord As an aside, this works for Python 2.6. Thanks. *From:* Michael Foord [mailto:fuzzy...@voidspace.org.uk] *Sent:* Friday, June 11, 2010 9:28 AM *To:* William Johnston *Cc:* Discussion of IronPython *Subject:* Re: [IronPython] NLTK in C# application? On 11/06/2010 12:06, William Johnston wrote: Hello, Where is the sys.path file located? If you start the IronPython console and execute import sys, then print sys.path it will show you all the directories it looks when you try to import a module. You can manually add a directory to this path (sys.path.append(r'c:\SomePath')) at the start of your code to add extra locations to your import path. All the best, Michael Thanks. *From:* Michael Foord [mailto:fuzzy...@voidspace.org.uk] *Sent:* Thursday, June 10, 2010 11:29 AM *To:* Discussion of IronPython *Cc:* William Johnston *Subject:* Re: [IronPython] NLTK in C# application? On 10/06/2010 14:57, William Johnston wrote: Hello, In order for NLTK to work, I need to install PyYaml. However, the PyYaml installer does not recognize the IronPython installation in the Registry. How do I alter the registry? I don't know - the folks on the pywin32 mailing list could probably tell you. An easier route would be to install Python, then install PyYaml, then either copy the files to somewhere on sys.path for IronPython (or add your Python site-packages folder to sys.path in your IronPython code). All the best, Michael Foord Thanks. *From:* users-boun...@lists.ironpython.com mailto:users-boun...@lists.ironpython.com [mailto:users-boun...@lists.ironpython.com] *On Behalf Of *Michael Foord *Sent:* Thursday, June 10, 2010 7:11 AM *To:* Discussion of IronPython *Subject:* Re: [IronPython] NLTK in C# application? On 10/06/2010 12:05, William Johnston wrote: Hello, How do I include the NLTK modules in a C# application? There is already code for embedded Python. The first step is to try importing it and running some examples from in IronPython. If that works then you just need to provide a 'bridge' layer that embeds IronPython in your C# app and allows you to call into IronPython to use NLTK. If NLTK *doesn't* work from IronPython it will probably be because it uses C extension modules not available in IronPython. One way round this is to use Ironclad. Again, try some NLTK examples from IronPython but with Ironclad and see if that works. http://www.resolversystems.com/products/ironclad/ If it still doesn't work it may be worth reporting back here with the problems to see if they are resolvable. All the best, Michael Foord Thanks. ___ Users mailing list Users@lists.ironpython.com mailto:Users@lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com -- http://www.ironpythoninaction.com/ http://www.voidspace.org.uk/blog READ CAREFULLY. By accepting and reading this email you agree, on behalf of your employer, to release me from all obligations and waivers arising from any and all NON-NEGOTIATED agreements, licenses, terms-of-service, shrinkwrap, clickwrap, browsewrap, confidentiality, non-disclosure, non-compete and acceptable use policies (BOGUS AGREEMENTS) that I have entered into with your employer, its partners, licensors, agents and assigns, in perpetuity, without prejudice to my ongoing rights and privileges. You further represent that you have the authority to release me from any BOGUS AGREEMENTS on behalf of your employer. ___ Users mailing list Users@lists.ironpython.com mailto:Users@lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com -- http://www.ironpythoninaction.com/ http://www.voidspace.org.uk/blog READ CAREFULLY. By accepting and reading this email you agree, on behalf of your employer, to release me from all obligations and waivers arising from any and all NON-NEGOTIATED agreements, licenses, terms-of-service, shrinkwrap, clickwrap, browsewrap, confidentiality, non-disclosure, non-compete and acceptable use policies (BOGUS AGREEMENTS) that I have entered into with your employer, its partners, licensors, agents and assigns, in perpetuity, without prejudice to my ongoing rights and privileges. You further represent that you have the authority to release me from any BOGUS AGREEMENTS on behalf of your employer. -- http://www.ironpythoninaction.com/ http
Re: [IronPython] NLTK in C# application?
On 10/06/2010 14:57, William Johnston wrote: Hello, In order for NLTK to work, I need to install PyYaml. However, the PyYaml installer does not recognize the IronPython installation in the Registry. How do I alter the registry? I don't know - the folks on the pywin32 mailing list could probably tell you. An easier route would be to install Python, then install PyYaml, then either copy the files to somewhere on sys.path for IronPython (or add your Python site-packages folder to sys.path in your IronPython code). All the best, Michael Foord Thanks. *From:* users-boun...@lists.ironpython.com [mailto:users-boun...@lists.ironpython.com] *On Behalf Of *Michael Foord *Sent:* Thursday, June 10, 2010 7:11 AM *To:* Discussion of IronPython *Subject:* Re: [IronPython] NLTK in C# application? On 10/06/2010 12:05, William Johnston wrote: Hello, How do I include the NLTK modules in a C# application? There is already code for embedded Python. The first step is to try importing it and running some examples from in IronPython. If that works then you just need to provide a 'bridge' layer that embeds IronPython in your C# app and allows you to call into IronPython to use NLTK. If NLTK *doesn't* work from IronPython it will probably be because it uses C extension modules not available in IronPython. One way round this is to use Ironclad. Again, try some NLTK examples from IronPython but with Ironclad and see if that works. http://www.resolversystems.com/products/ironclad/ If it still doesn't work it may be worth reporting back here with the problems to see if they are resolvable. All the best, Michael Foord Thanks. ___ Users mailing list Users@lists.ironpython.com mailto:Users@lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com -- http://www.ironpythoninaction.com/ http://www.voidspace.org.uk/blog READ CAREFULLY. By accepting and reading this email you agree, on behalf of your employer, to release me from all obligations and waivers arising from any and all NON-NEGOTIATED agreements, licenses, terms-of-service, shrinkwrap, clickwrap, browsewrap, confidentiality, non-disclosure, non-compete and acceptable use policies (BOGUS AGREEMENTS) that I have entered into with your employer, its partners, licensors, agents and assigns, in perpetuity, without prejudice to my ongoing rights and privileges. You further represent that you have the authority to release me from any BOGUS AGREEMENTS on behalf of your employer. ___ Users mailing list Users@lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com -- http://www.ironpythoninaction.com/ http://www.voidspace.org.uk/blog READ CAREFULLY. By accepting and reading this email you agree, on behalf of your employer, to release me from all obligations and waivers arising from any and all NON-NEGOTIATED agreements, licenses, terms-of-service, shrinkwrap, clickwrap, browsewrap, confidentiality, non-disclosure, non-compete and acceptable use policies (BOGUS AGREEMENTS) that I have entered into with your employer, its partners, licensors, agents and assigns, in perpetuity, without prejudice to my ongoing rights and privileges. You further represent that you have the authority to release me from any BOGUS AGREEMENTS on behalf of your employer. ___ Users mailing list Users@lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com
Re: [IronPython] Using Epydoc with IronPython 2.6.1
On 09/06/2010 16:55, Danny Fernandez wrote: Hi All, I am a newbie in IronPython world which by the way rocks. I tried posting yesterday so I am not sure what happened so sorry if there is a double post. I am having trouble trying to use epydoc. I have IronPython 2.6.1 for .NET 2.0 on my 32-bit Windows XP box. I am not sure if I have set it up correctly it is probably me not setting up things correctly. I installed the epydoc source in c:\python\epydoc and set IRONPATHHOME is set to C:\python\epydoc\. I am following an example of using epydoc from their website and added the debug arg to get more information so I cd in C:\python\epydoc\scripts and executed the following ipy epydoc.py --html --debug sys -o sys_docs Traceback (most recent call last):-] Building documentation: sys File epydoc.py, line 16, in module File C:\python\epydoc\epydoc\cli.py, line 965, in cli File C:\python\epydoc\epydoc\docbuilder.py, line 454, in _get_docs_from_pyname File C:\python\epydoc\epydoc\docparser.py, line 209, in parse_docs File C:\python\epydoc\epydoc\docintrospecter.py, line 131, in introspect_docs File C:\python\epydoc\epydoc\docintrospecter.py, line 275, in introspect_module File C:\python\epydoc\epydoc\docintrospecter.py, line 131, in introspect_docs File C:\python\epydoc\epydoc\docintrospecter.py, line 392, in introspect_class TypeError: instancemethod.__cmp__(x,y) requires y to be a 'instancemethod', not a NoneType I tried find information on using IronPython with epydoc but with no luck. I got pydoc to work but it pulled documentation for the clr module which I use of course which took most of the documentation for my module. I thought I can try epydoc with the parse only feature. I appeciate any feedback. Hmm... no idea on the specific problem - but this *may* be related: IronPython 2.6.1: class X(object): ... def f(s): pass ... a = X() a.f.__cmp__ Traceback (most recent call last): File stdin, line 1, in module AttributeError: 'instancemethod' object has no attribute '__cmp__' CPython 2.6.5: class X(object): ... def f(s): pass ... a = X() a.f.__cmp__ method-wrapper '__cmp__' of instancemethod object at 0x01858DA0 Michael Thanks Danny ___ Users mailing list Users@lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com -- http://www.ironpythoninaction.com/ http://www.voidspace.org.uk/blog READ CAREFULLY. By accepting and reading this email you agree, on behalf of your employer, to release me from all obligations and waivers arising from any and all NON-NEGOTIATED agreements, licenses, terms-of-service, shrinkwrap, clickwrap, browsewrap, confidentiality, non-disclosure, non-compete and acceptable use policies (BOGUS AGREEMENTS) that I have entered into with your employer, its partners, licensors, agents and assigns, in perpetuity, without prejudice to my ongoing rights and privileges. You further represent that you have the authority to release me from any BOGUS AGREEMENTS on behalf of your employer. ___ Users mailing list Users@lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com
Re: [IronPython] Using Epydoc with IronPython 2.6.1
On 09/06/2010 23:43, Danny Fernandez wrote: Hi Michael, Are there any documentation tools that would work with IronPython that you would recommend? Hmmm... in terms of automatically generating api documentation from docstrings there are embarrassingly few for Python - let alone IronPython. Sphinx is great for building documentation but doesn't need to be run *with* IronPython and won't pull docstrings from your API for you. Maybe other people have suggestions. All the best, Michael I got pydoc to work on a small sample python file but the html documentation included imports. I had small python file but the clr module took most of the html documentation. I am newbie so I could be setting pydoc incorrectly. Thanks. Danny On Wed, Jun 9, 2010 at 10:56 AM, Michael Foord fuzzy...@voidspace.org.uk mailto:fuzzy...@voidspace.org.uk wrote: On 09/06/2010 16:55, Danny Fernandez wrote: Hi All, I am a newbie in IronPython world which by the way rocks. I tried posting yesterday so I am not sure what happened so sorry if there is a double post. I am having trouble trying to use epydoc. I have IronPython 2.6.1 for .NET 2.0 on my 32-bit Windows XP box. I am not sure if I have set it up correctly it is probably me not setting up things correctly. I installed the epydoc source in c:\python\epydoc and set IRONPATHHOME is set to C:\python\epydoc\. I am following an example of using epydoc from their website and added the debug arg to get more information so I cd in C:\python\epydoc\scripts and executed the following ipy epydoc.py --html --debug sys -o sys_docs Traceback (most recent call last):-] Building documentation: sys File epydoc.py, line 16, in module File C:\python\epydoc\epydoc\cli.py, line 965, in cli File C:\python\epydoc\epydoc\docbuilder.py, line 454, in _get_docs_from_pyname File C:\python\epydoc\epydoc\docparser.py, line 209, in parse_docs File C:\python\epydoc\epydoc\docintrospecter.py, line 131, in introspect_docs File C:\python\epydoc\epydoc\docintrospecter.py, line 275, in introspect_module File C:\python\epydoc\epydoc\docintrospecter.py, line 131, in introspect_docs File C:\python\epydoc\epydoc\docintrospecter.py, line 392, in introspect_class TypeError: instancemethod.__cmp__(x,y) requires y to be a 'instancemethod', not a NoneType I tried find information on using IronPython with epydoc but with no luck. I got pydoc to work but it pulled documentation for the clr module which I use of course which took most of the documentation for my module. I thought I can try epydoc with the parse only feature. I appeciate any feedback. Hmm... no idea on the specific problem - but this *may* be related: IronPython 2.6.1: class X(object): ... def f(s): pass ... a = X() a.f.__cmp__ Traceback (most recent call last): File stdin, line 1, in module AttributeError: 'instancemethod' object has no attribute '__cmp__' CPython 2.6.5: class X(object): ... def f(s): pass ... a = X() a.f.__cmp__ method-wrapper '__cmp__' of instancemethod object at 0x01858DA0 Michael Thanks Danny ___ Users mailing list Users@lists.ironpython.com mailto:Users@lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com -- http://www.ironpythoninaction.com/ http://www.voidspace.org.uk/blog READ CAREFULLY. By accepting and reading this email you agree, on behalf of your employer, to release me from all obligations and waivers arising from any and all NON-NEGOTIATED agreements, licenses, terms-of-service, shrinkwrap, clickwrap, browsewrap, confidentiality, non-disclosure, non-compete and acceptable use policies (”BOGUS AGREEMENTS”) that I have entered into with your employer, its partners, licensors, agents and assigns, in perpetuity, without prejudice to my ongoing rights and privileges. You further represent that you have the authority to release me from any BOGUS AGREEMENTS on behalf of your employer. ___ Users mailing list Users@lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com -- http://www.ironpythoninaction.com/ http://www.voidspace.org.uk/blog READ CAREFULLY. By accepting and reading this email you agree, on behalf of your employer, to release me from all obligations and waivers arising from any and all NON-NEGOTIATED agreements, licenses, terms-of-service, shrinkwrap, clickwrap, browsewrap, confidentiality, non-disclosure, non-compete and acceptable use policies (”BOGUS AGREEMENTS”) that I have entered into with your employer, its partners, licensors, agents and assigns, in perpetuity, without prejudice to my ongoing rights
Re: [IronPython] How should I install packages?
On 07/06/2010 13:43, Matthew Wilson wrote: I've got an all-python package that should be compatible with ironpython. It seems like distutils.setup doesn't exist though, so my original setup.py script won't work. I might tweak my setup.py so that when it can't find a distutils.setup, it goes into ironpython mode and then just manually copies stuff. So where should I install stuff? Just copy it somewhere in sys.path? I think that's about the current practise... :-) Michael Is there a convention other people are following? Matt PS and OT: I'm trying to use gmane to access this mailing list with slrn (a command-line newsreader) and while I can post to the list, no new posts ever show up. I use gmane and slrn to read a lot of other lists and they work fine. Any ideas? ___ Users mailing list Users@lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com -- http://www.ironpythoninaction.com/ http://www.voidspace.org.uk/blog READ CAREFULLY. By accepting and reading this email you agree, on behalf of your employer, to release me from all obligations and waivers arising from any and all NON-NEGOTIATED agreements, licenses, terms-of-service, shrinkwrap, clickwrap, browsewrap, confidentiality, non-disclosure, non-compete and acceptable use policies (”BOGUS AGREEMENTS”) that I have entered into with your employer, its partners, licensors, agents and assigns, in perpetuity, without prejudice to my ongoing rights and privileges. You further represent that you have the authority to release me from any BOGUS AGREEMENTS on behalf of your employer. ___ Users mailing list Users@lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com
[IronPython] Performance str.replace in Silverlight
Hey guys, I just tracked down a really nasty performance bug in our Silverlight application. It turned out that doing a simple string replace in a 400 character string was taking 700ms. As we actually do two replaces and the text is usually substantially longer this was a real problem. I fixed the problem by switching to explicitly calling the .NET String.Replace instead of str.replace, so it looks like an IronPython issue. It doesn't happen with *all* text, but it looks like non-ascii exacerbates the problem. The particular text that triggered it was: Die Neuanlage einer Welle muss auch zu Einträgen in der Tabelle dbo_tv_wellenwebsitesfirmenverbinder führen. Dabei werden die Zuordnungen aus der Vorwelle bei der Neuanlage einer neuen Welle einmalig übernommen. Jede Zeile der Vorwelle wird also kopiert und die Kopie erhält die Welle_uniqueID der neuen Welle. Die Verbindung zwischen Website_uniqueID - Firmen_uniqueID - FirmenAbrechnung_uniqueID bleibt somit erhalten. The replace code was: text = text.replace('\r\n', '\n').replace('\r', '\n') The fix was: text = String.Replace(text, '\r\n', '\n') text = String.Replace(text, '\r', '\n') All the best, Michael Foord -- http://www.ironpythoninaction.com/ http://www.voidspace.org.uk/blog READ CAREFULLY. By accepting and reading this email you agree, on behalf of your employer, to release me from all obligations and waivers arising from any and all NON-NEGOTIATED agreements, licenses, terms-of-service, shrinkwrap, clickwrap, browsewrap, confidentiality, non-disclosure, non-compete and acceptable use policies (”BOGUS AGREEMENTS”) that I have entered into with your employer, its partners, licensors, agents and assigns, in perpetuity, without prejudice to my ongoing rights and privileges. You further represent that you have the authority to release me from any BOGUS AGREEMENTS on behalf of your employer. ___ Users mailing list Users@lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com
Re: [IronPython] App stops responding, form won't refresh
On 26/05/2010 22:40, robinsiebler wrote: This is my 1st IronPython/.NET app. It is really simple, all it does is zip all the files in a folder into an archive, 1 file per zip. The problem is that when it is zipping large files 200MB+ the app stops responding. It is still zipping files, but the UI doesn't update. I don't know how to fix this. If you create a form and perform any activity on the same thread that created the form then you will block until that activity is completed. Instead you can create a background thread and post updates to the ui from that thread by invoking. If you are using Windows Forms then you might find this example of invoking onto the gui thread useful: http://www.ironpython.info/index.php/Invoking_onto_the_GUI_%28Control%29_Thread There is also an example of basic threading here: http://www.voidspace.org.uk/ironpython/threading.shtml All the best, Michael Foord The project is here - http://cid-0c375b07f1f323b6.skydrive.live.com/self.aspx/.Public/ZipfilesGUI.zip I think I need to add a thread to update the form, but all of my attempts have failed. Any help in this regard would be greatly appreciated. -- http://www.ironpythoninaction.com/ http://www.voidspace.org.uk/blog READ CAREFULLY. By accepting and reading this email you agree, on behalf of your employer, to release me from all obligations and waivers arising from any and all NON-NEGOTIATED agreements, licenses, terms-of-service, shrinkwrap, clickwrap, browsewrap, confidentiality, non-disclosure, non-compete and acceptable use policies (”BOGUS AGREEMENTS”) that I have entered into with your employer, its partners, licensors, agents and assigns, in perpetuity, without prejudice to my ongoing rights and privileges. You further represent that you have the authority to release me from any BOGUS AGREEMENTS on behalf of your employer. ___ Users mailing list Users@lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com
Re: [IronPython] App stops responding, form won't refresh
On 26/05/2010 23:46, robinsiebler wrote: I've looked at both of them before I posted this, but I'm just failing to understand it I guess. Perhaps this example would be better - it shows updating a progress bar from a calculation being run in a background thread: http://www.ironpython.info/index.php/Progress_Bar All the best, Michael Michael Foord-5 wrote: On 26/05/2010 22:40, robinsiebler wrote: This is my 1st IronPython/.NET app. It is really simple, all it does is zip all the files in a folder into an archive, 1 file per zip. The problem is that when it is zipping large files 200MB+ the app stops responding. It is still zipping files, but the UI doesn't update. I don't know how to fix this. If you create a form and perform any activity on the same thread that created the form then you will block until that activity is completed. Instead you can create a background thread and post updates to the ui from that thread by invoking. If you are using Windows Forms then you might find this example of invoking onto the gui thread useful: http://www.ironpython.info/index.php/Invoking_onto_the_GUI_%28Control%29_Thread There is also an example of basic threading here: http://www.voidspace.org.uk/ironpython/threading.shtml All the best, Michael Foord The project is here - http://cid-0c375b07f1f323b6.skydrive.live.com/self.aspx/.Public/ZipfilesGUI.zip I think I need to add a thread to update the form, but all of my attempts have failed. Any help in this regard would be greatly appreciated. -- http://www.ironpythoninaction.com/ http://www.voidspace.org.uk/blog READ CAREFULLY. By accepting and reading this email you agree, on behalf of your employer, to release me from all obligations and waivers arising from any and all NON-NEGOTIATED agreements, licenses, terms-of-service, shrinkwrap, clickwrap, browsewrap, confidentiality, non-disclosure, non-compete and acceptable use policies (”BOGUS AGREEMENTS”) that I have entered into with your employer, its partners, licensors, agents and assigns, in perpetuity, without prejudice to my ongoing rights and privileges. You further represent that you have the authority to release me from any BOGUS AGREEMENTS on behalf of your employer. ___ Users mailing list Users@lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com -- http://www.ironpythoninaction.com/ http://www.voidspace.org.uk/blog READ CAREFULLY. By accepting and reading this email you agree, on behalf of your employer, to release me from all obligations and waivers arising from any and all NON-NEGOTIATED agreements, licenses, terms-of-service, shrinkwrap, clickwrap, browsewrap, confidentiality, non-disclosure, non-compete and acceptable use policies (”BOGUS AGREEMENTS”) that I have entered into with your employer, its partners, licensors, agents and assigns, in perpetuity, without prejudice to my ongoing rights and privileges. You further represent that you have the authority to release me from any BOGUS AGREEMENTS on behalf of your employer. ___ Users mailing list Users@lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com
Re: [IronPython] Some More Newbie Questions
On 11/05/2010 21:50, Dino Viehland wrote: Matt Funke: In IronPython Tools for Visual Studio 2010, how do you make it clear where the location of a file to be included is? I have this line that trips up the execution: from avalon import * ... even though avalon.py is in the same directory, and that directory is pointed to by the Search Path. It throws an ImportError, insisting that there is No module named avalon. Is there some other thing I need to point at this that I'm missing? How are you launching the app? Is it via the interactive window or are you doing a start w/ or w/o debugger? It looks like we don't set the path in the interactive window but we do otherwise. Of course being in the same directory (as the start file) should mean that it's available for import anyway. If you could do: import System import sys print System.Environment.CurrentDirectory, sys.path and see if those values are the correct dir for your project and include the directories you've setup in the search path. I'm also not sure how I feel about setting the search path via the UI in general. I'm a little concerned that it'll make it too easy to create scripts that work when launched in VS but not outside of VS. So if anyone has any feedback on how this should be handled I'd love to hear it. Hmm... Wing lets you set the search paths for the IDE so that it can correctly find modules / packages for intellisense (etc). It *doesn't* automatically add these path entries to sys.path when you run under debugging though. Michael ___ Users mailing list Users@lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com -- http://www.ironpythoninaction.com/ http://www.voidspace.org.uk/blog READ CAREFULLY. By accepting and reading this email you agree, on behalf of your employer, to release me from all obligations and waivers arising from any and all NON-NEGOTIATED agreements, licenses, terms-of-service, shrinkwrap, clickwrap, browsewrap, confidentiality, non-disclosure, non-compete and acceptable use policies (”BOGUS AGREEMENTS”) that I have entered into with your employer, its partners, licensors, agents and assigns, in perpetuity, without prejudice to my ongoing rights and privileges. You further represent that you have the authority to release me from any BOGUS AGREEMENTS on behalf of your employer. ___ Users mailing list Users@lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com
Re: [IronPython] Can't install IronPython Tools for Visual Studio
On 02/05/2010 13:34, Lukáš Duběda wrote: Hi there everyone, first off, congratulations for pushing the IPy Tools out! KUDOS! Now, I have a problem installing it, unfortunately :( I'm sure I'm doing something wrong as I have almost zero experience with Visual Studio. I went to the MS site and downloaded what seemed to be an obvious choice a Visual Studio 2010 Express for C#, Visual Studio Express does not allow you to install extensions like IPy Tools. Fortunately IPy tools works with the Visual Studio Isolated Shell that can be installed standalone, without a Visual Studio install. http://www.microsoft.com/downloads/details.aspx?displaylang=enFamilyID=dfba7ac4-5366-456e-abd6-0e3e6ba83b7c Michael I installed it and downloaded the Iron Python extension. However, as soon as I doble-click on the IronPythonTools.vsix I get this message: This extension is not installable on any currently installed products. Anyone knows why this is? Am I missing some additional piece of the package? I installed everything except for the MSQL server stuff from the vcs_web.exe package. Thanks a lot in advance for any tips and hints, cheers, Lukáš Duběda Director [T] +420 602 444 164 duber studio(tm) [M] i...@duber.cz [W] http://www.duber.cz [A] R.A.Dvorského 601, Praha 10 [A] 10900, Czech Republic, Europe ___ Users mailing list Users@lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com -- http://www.ironpythoninaction.com/ http://www.voidspace.org.uk/blog READ CAREFULLY. By accepting and reading this email you agree, on behalf of your employer, to release me from all obligations and waivers arising from any and all NON-NEGOTIATED agreements, licenses, terms-of-service, shrinkwrap, clickwrap, browsewrap, confidentiality, non-disclosure, non-compete and acceptable use policies (”BOGUS AGREEMENTS”) that I have entered into with your employer, its partners, licensors, agents and assigns, in perpetuity, without prejudice to my ongoing rights and privileges. You further represent that you have the authority to release me from any BOGUS AGREEMENTS on behalf of your employer. ___ Users mailing list Users@lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com
[IronPython] Calling explicitly-implemented interface methods
Hey all, I'm porting the dotnet-integration document that comes with IronPython to Try Python. The following example doesn't work, because RegistryKey isn't available on Silverlight. Can anyone suggest a good alternative of an explicitly implemented interface method on a class in Silverlight? \.NET allows a method with a different name to override a base method implementation or interface method slot. This is useful if a type implements two interfaces with methods with the same name. This is known as `explicity implemented interface methods http://msdn.microsoft.com/en-us/library/4taxa8t2.aspx`_. For example, `Microsoft.Win32.RegistryKey` implements `System.IDisposable.Dispose` explicitly:: from Microsoft.Win32 import RegistryKey clr.GetClrType(RegistryKey).GetMethod(Flush) #doctest: +ELLIPSIS System.Reflection.RuntimeMethodInfo object at ... [Void Flush()] clr.GetClrType(RegistryKey).GetMethod(Dispose) In such cases, IronPython tries to expose the method using its simple name - if there is no ambiguity:: from Microsoft.Win32 import Registry rkey = Registry.CurrentUser.OpenSubKey(Software) rkey.Dispose() However, it is possible that the type has another method with the same name. In that case, the explicitly implemented method is not accessible as an attribute. However, it can still be called by using the unbound class instance method syntax:: rkey = Registry.CurrentUser.OpenSubKey(Software) System.IDisposable.Dispose(rkey) All the best, Michael Foord -- http://www.ironpythoninaction.com/ http://www.voidspace.org.uk/blog READ CAREFULLY. By accepting and reading this email you agree, on behalf of your employer, to release me from all obligations and waivers arising from any and all NON-NEGOTIATED agreements, licenses, terms-of-service, shrinkwrap, clickwrap, browsewrap, confidentiality, non-disclosure, non-compete and acceptable use policies (”BOGUS AGREEMENTS”) that I have entered into with your employer, its partners, licensors, agents and assigns, in perpetuity, without prejudice to my ongoing rights and privileges. You further represent that you have the authority to release me from any BOGUS AGREEMENTS on behalf of your employer. ___ Users mailing list Users@lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com
Re: [IronPython] Calling explicitly-implemented interface methods
On 30/04/2010 23:58, Dino Viehland wrote: Michael wrote: On 30/04/2010 23:32, Dino Viehland wrote: Michael wrote: Hey all, I'm porting the dotnet-integration document that comes with IronPython to Try Python. The following example doesn't work, because RegistryKey isn't available on Silverlight. Can anyone suggest a good alternative of an explicitly implemented interface method on a class in Silverlight? One example might be Python file objects which also implement IDisposable. That would be a really inconvenient example to pick, since in Try Python I patch __builtin__.file to be a custom type that reads / writes files to local storage. :-) Can you think of anything else? It's kind of lame but Python lists explicitly implement IList.Remove. Cool - that will do nicely. Thanks Michael ___ Users mailing list Users@lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com -- http://www.ironpythoninaction.com/ http://www.voidspace.org.uk/blog READ CAREFULLY. By accepting and reading this email you agree, on behalf of your employer, to release me from all obligations and waivers arising from any and all NON-NEGOTIATED agreements, licenses, terms-of-service, shrinkwrap, clickwrap, browsewrap, confidentiality, non-disclosure, non-compete and acceptable use policies (”BOGUS AGREEMENTS”) that I have entered into with your employer, its partners, licensors, agents and assigns, in perpetuity, without prejudice to my ongoing rights and privileges. You further represent that you have the authority to release me from any BOGUS AGREEMENTS on behalf of your employer. ___ Users mailing list Users@lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com
Re: [IronPython] Calling explicitly-implemented interface methods
On 30/04/2010 23:58, Dino Viehland wrote: Michael wrote: On 30/04/2010 23:32, Dino Viehland wrote: Michael wrote: Hey all, I'm porting the dotnet-integration document that comes with IronPython to Try Python. The following example doesn't work, because RegistryKey isn't available on Silverlight. Can anyone suggest a good alternative of an explicitly implemented interface method on a class in Silverlight? One example might be Python file objects which also implement IDisposable. That would be a really inconvenient example to pick, since in Try Python I patch __builtin__.file to be a custom type that reads / writes files to local storage. :-) Can you think of anything else? It's kind of lame but Python lists explicitly implement IList.Remove. Hmm... although the following doesn't return None - meaning that it doesn't fit the pattern of the first example: clr.GetClrType(list).GetMethod(Remove) *dammit* :-) Michael ___ Users mailing list Users@lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com -- http://www.ironpythoninaction.com/ http://www.voidspace.org.uk/blog READ CAREFULLY. By accepting and reading this email you agree, on behalf of your employer, to release me from all obligations and waivers arising from any and all NON-NEGOTIATED agreements, licenses, terms-of-service, shrinkwrap, clickwrap, browsewrap, confidentiality, non-disclosure, non-compete and acceptable use policies (”BOGUS AGREEMENTS”) that I have entered into with your employer, its partners, licensors, agents and assigns, in perpetuity, without prejudice to my ongoing rights and privileges. You further represent that you have the authority to release me from any BOGUS AGREEMENTS on behalf of your employer. ___ Users mailing list Users@lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com
Re: [IronPython] How to install 3rd part packages into IronPython ?
On 28/04/2010 03:48, David Shieh wrote: [snip] setuptools is a complex, horrible old beast and I wouldn't like to guess at its IronPython compatibility. Shame MySQLdb depends on it for an install - but MySQLdb almost certainly depends on C extensions anyway. In the long run distutils2 will replace setuptools entirely (for CPython the distribute package has *already* replaced it whilst remaining compatible). The distutils2 guys are *very* open to input - so 'someone' should run the tests with IronPython and report any problems. Yes, you're right. MySQLdb does have some c files that need to be compiled. And I don't think Windows got a good compile environment for this. This bothers me to much. For CPython2.6, I have to find a binary package of MySQLdb, but for IronPython, I can't find any binary. The Windows compile environment for Python C extensions is most easily setup by having the correct version of Visual Studio installed. Packages for Python based on C extensions normally *don't work at all in IronPython* - this is why you won't find binaries for IronPython for C extensions... One way to use Python C extensions with IronPython is through Ironclad: http://www.resolversystems.com/products/ironclad/ All the best, Michael Foord distutils used to break *after* installing a pure-Python package for IronPython when it attempted to do byte-code compilation. This specific problem is fixed in trunk but I don't know if it is fixed in the version of distutils shipped with IronPython 2.6. This was the last step - so the error was alarming but wouldn't stop the install. I will try it later. Dont have too much time for test now. All the best, Michael Foord On 27/04/2010 07:19, David Shieh wrote: Hi guys, I don't whether somebody else asked this question, but I am really confused about this. I have already installled IronPython2.6 and add it into my system's path, so I can directly type ipy to start IronPython2.6. So I tried ipy setup.py install to install MySQLdb, but it give me an error said no module named setuptools. Then I download setuptools and install it, it gave me an error: No module named pkg_resources. Why doesn't IronPython2.6 ship with a setuptools like easy_install ? Now, I can't install any 3rd party package and don't know how to fix it. Regards, David -- -- Attitude determines everything ! -- ___ Users mailing list Users@lists.ironpython.com mailto:Users@lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com -- http://www.ironpythoninaction.com/ http://www.voidspace.org.uk/blog READ CAREFULLY. By accepting and reading this email you agree, on behalf of your employer, to release me from all obligations and waivers arising from any and all NON-NEGOTIATED agreements, licenses, terms-of-service, shrinkwrap, clickwrap, browsewrap, confidentiality, non-disclosure, non-compete and acceptable use policies (”BOGUS AGREEMENTS”) that I have entered into with your employer, its partners, licensors, agents and assigns, in perpetuity, without prejudice to my ongoing rights and privileges. You further represent that you have the authority to release me from any BOGUS AGREEMENTS on behalf of your employer. ___ Users mailing list Users@lists.ironpython.com mailto:Users@lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com -- -- Attitude determines everything ! -- ___ Users mailing list Users@lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com -- http://www.ironpythoninaction.com/ http://www.voidspace.org.uk/blog READ CAREFULLY. By accepting and reading this email you agree, on behalf of your employer, to release me from all obligations and waivers arising from any and all NON-NEGOTIATED agreements, licenses, terms-of-service, shrinkwrap, clickwrap, browsewrap, confidentiality, non-disclosure, non-compete and acceptable use policies (”BOGUS AGREEMENTS”) that I have entered into with your employer, its partners, licensors, agents and assigns, in perpetuity, without prejudice to my ongoing rights and privileges. You further represent that you have the authority to release me from any BOGUS AGREEMENTS on behalf of your employer. ___ Users mailing list Users@lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com
Re: [IronPython] How to install 3rd part packages into IronPython ?
Hello David, Not sure how close distutils is to working with IronPython. The correct way to install packages for an installed version of IronPython *should* be to use the user site-packages rather than the global site-packages (which won't be writable for IronPython without admin rights): http://www.python.org/dev/peps/pep-0370/ ipy setup.py install --user setuptools is a complex, horrible old beast and I wouldn't like to guess at its IronPython compatibility. Shame MySQLdb depends on it for an install - but MySQLdb almost certainly depends on C extensions anyway. In the long run distutils2 will replace setuptools entirely (for CPython the distribute package has *already* replaced it whilst remaining compatible). The distutils2 guys are *very* open to input - so 'someone' should run the tests with IronPython and report any problems. distutils used to break *after* installing a pure-Python package for IronPython when it attempted to do byte-code compilation. This specific problem is fixed in trunk but I don't know if it is fixed in the version of distutils shipped with IronPython 2.6. This was the last step - so the error was alarming but wouldn't stop the install. All the best, Michael Foord On 27/04/2010 07:19, David Shieh wrote: Hi guys, I don't whether somebody else asked this question, but I am really confused about this. I have already installled IronPython2.6 and add it into my system's path, so I can directly type ipy to start IronPython2.6. So I tried ipy setup.py install to install MySQLdb, but it give me an error said no module named setuptools. Then I download setuptools and install it, it gave me an error: No module named pkg_resources. Why doesn't IronPython2.6 ship with a setuptools like easy_install ? Now, I can't install any 3rd party package and don't know how to fix it. Regards, David -- -- Attitude determines everything ! -- ___ Users mailing list Users@lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com -- http://www.ironpythoninaction.com/ http://www.voidspace.org.uk/blog READ CAREFULLY. By accepting and reading this email you agree, on behalf of your employer, to release me from all obligations and waivers arising from any and all NON-NEGOTIATED agreements, licenses, terms-of-service, shrinkwrap, clickwrap, browsewrap, confidentiality, non-disclosure, non-compete and acceptable use policies (”BOGUS AGREEMENTS”) that I have entered into with your employer, its partners, licensors, agents and assigns, in perpetuity, without prejudice to my ongoing rights and privileges. You further represent that you have the authority to release me from any BOGUS AGREEMENTS on behalf of your employer. ___ Users mailing list Users@lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com
[IronPython] Try Python updated for IronPython 2.6 Silverlight 4 (sort of)
Hello all, I've updated Try Python to use IronPython 2.6.1 and it now works with Silverlight 4 - mostly. http://www.trypython.org/ It works with Firefox and IE on Windows and Safari on Mac OS X, but throws a weird error (for me at least) with Firefox on Mac OS X. SystemError: [InvalidOperation_IComparerFailed] Arguments: Debugging resource strings are unavailable. Often the key and arguments provide sufficient information to diagnose the problem. See http://go.microsoft.com/fwlink/?linkid=106663Version=4.0.50401.0File=mscorlib.dllKey=InvalidOperation_IComparerFailed The line that apparently causes the error is in types.py: NoneType = type(None) Interestingly I see a very similar error at http://ironpython.net/try/ SystemError: [InvalidOperation_IComparerFailed] Arguments: Debugging resource strings are unavailable. Often the key and arguments provide sufficient information to diagnose the problem. See http://go.microsoft.com/fwlink/?linkid=106663Version=4.0.50401.0File=mscorlib.dllKey=InvalidOperation_IComparerFailed wpf.py Line 27: Line 28: def __Setup(): Line 29: for name in dir(Colors): Line 30: c = getattr(Colors, name) Line 31: if isinstance(c, Color): SystemError at __Setup in wpf.py, line 29 at wpf.py in wpf.py, line 35 at app.py in app.py, line 34 All the best, Michael Foord -- http://www.ironpythoninaction.com/ http://www.voidspace.org.uk/blog READ CAREFULLY. By accepting and reading this email you agree, on behalf of your employer, to release me from all obligations and waivers arising from any and all NON-NEGOTIATED agreements, licenses, terms-of-service, shrinkwrap, clickwrap, browsewrap, confidentiality, non-disclosure, non-compete and acceptable use policies (”BOGUS AGREEMENTS”) that I have entered into with your employer, its partners, licensors, agents and assigns, in perpetuity, without prejudice to my ongoing rights and privileges. You further represent that you have the authority to release me from any BOGUS AGREEMENTS on behalf of your employer. ___ Users mailing list Users@lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com
[IronPython] Accessing assembly names from Silverlight
Hello all, The following code dies in Silverlight: import clr clr.AddReference(System.Xml) System.Xml in [assembly.GetName().Name for assembly in clr.References] SystemError: Security transparent method System.Reflection.Assebly.GetName() cannot access Microsoft.Scripting.Actions... using reflection. This is making it less useful to port the IronPython dotnet integration tutorial to Try Python. :-) Repeated calls throw a slightly different error in the end (still a system error - but a different message). All the best, Michael Foord -- http://www.ironpythoninaction.com/ http://www.voidspace.org.uk/blog READ CAREFULLY. By accepting and reading this email you agree, on behalf of your employer, to release me from all obligations and waivers arising from any and all NON-NEGOTIATED agreements, licenses, terms-of-service, shrinkwrap, clickwrap, browsewrap, confidentiality, non-disclosure, non-compete and acceptable use policies (”BOGUS AGREEMENTS”) that I have entered into with your employer, its partners, licensors, agents and assigns, in perpetuity, without prejudice to my ongoing rights and privileges. You further represent that you have the authority to release me from any BOGUS AGREEMENTS on behalf of your employer. ___ Users mailing list Users@lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com
Re: [IronPython] Still stuck on rich editor with IronPython and Silverlight
So setting the RuntimeVersion in the Chiron.exe.config to 4.0.50401.0 (and also updating our Silverlight binaries to the standard IronPython 2.6.1 version - which I *thought* I had already done) works! We now have a Silverlight Rich Text Editor working in our app. Still a bit of work to fully integrate it, but it is now possible. http://skitch.com/fuzzyman/dy8qe/silverlight-template Many Thanks! Michael On 23/04/2010 01:53, Jimmy Schementi wrote: On 23/04/2010 00:10, Lukas Cenovsky wrote: I think when AppManifest.xaml is in app folder, Chiron won't generate it. That is correct - which means when we add (or remove) an assembly we have to also manually add it to the AppManifest because Chiron will no longer do it for us... You don't need to save the AppManifest.xaml to disk, just change Silverlight\bin\Chiron.exe.config (in your IronPython installation directory). It's a very simple change to theAppManifest.xaml section: where it says RuntimeVersion change its value to 4.0.50401.0. This will cause Chiron.exe to generate the appropriate AppManifest.xaml for you, regardless of whether or not you want to generate it to disk. However, if you don't want to change every installation of IronPython that you have, saving the AppManifest.xaml to disk is totally fine, and will still work in the scenario you're describing. Chiron does NOT do any detection of assemblies in your app and add them to the AppManifest.xaml, because it doesn't need to. The AppManifest.xaml'sAssemblyParts section is the equivalent of Add Reference in a C# Silverlight app. In Python, that just translates to a clr.AddReferenceToFile; there is no need to list it in the AppManifest.xaml. Even listing it in the AppManfiest.xaml still requires you to do use clr.AddReferenceToFile, as the DLR integration does not load AssemblyParts for Python to use (maybe it should, but it doesn't today). ~Jimmy ___ Users mailing list Users@lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com -- http://www.ironpythoninaction.com/ ___ Users mailing list Users@lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com
Re: [IronPython] Still stuck on rich editor with IronPython and Silverlight
Thanks very much - this is great news for us! I'm trying this now. Having to hardcode our AppManifest.xaml is unfortunate as we normally let Chiron generate this for us (whilst developing) - but I guess we could just recompile Chiron. Much appreciated, Michael On 22/04/2010 23:13, Jimmy Schementi wrote: AH! Thanks Dino! In the XAP file there is an AppManifest.xaml, which specifies a version number. Ours (both what Chiron generates and what's on gestalt.ironpython.net) is still set to a version of SL2, for Moonlight compat, which turns on quirks mode when running in SL3+. Changing Chiron.exe.config's AppManifest template (or your own copy of AppManifest.xaml) to have SL4's version number will run without quirks mode enabled, hopefully letting you use the richtextbox. For gestalt.ironpython.net, we will have multiple XAPs depending on what SL version you want to use, and the SL3 and 4 XAPs will have updates version numbers. Michael, let me know how this works out for you. ~Jimmy On Apr 22, 2010, at 1:11 PM, Dino Viehlanddi...@microsoft.com wrote: Ok, I know what's going on here, but I don't know the exact solution. I'm hoping one of you two know the solution. The good news is there's no bug, the rich text box isn't supposed to work! :) What's going on is that quirks mode is disabling the creation of the rich text box. This appears to be due to a version check against the version that's coming from the XAP. So I guess fixing some Silverlight ' version specified in the XAP file will fix this - I don't know if that's a XAP being generated by Chiron or if it's something on gestalt.ironpython.net. -Original Message- From: users-boun...@lists.ironpython.com [mailto:users- boun...@lists.ironpython.com] On Behalf Of Michael Foord Sent: Friday, April 16, 2010 6:21 PM To: Discussion of IronPython Cc: Jimmy Schementi Subject: Re: [IronPython] Still stuck on rich editor with IronPython and Silverlight On 17/04/2010 03:19, Jimmy Schementi wrote: Michael, let's get Dino in on this ... Dino, This seems like our fault, but I'm not savvy enough to track it down or verify my claim. Seems like it doesn't work regardless of invoking via reflection or ref.emit code; calling it's constructor 10,000 times still gave the same result. As Michael said, doing anything with RichTextBox fails when invoked from IronPython, but works fine when invoked without IronPython on the stack (pure C# app, for example). I'm amazed that it fails when *called* from C#, meaning that IronPython is doing something to make statically compiled code fail. Thanks for looking at this Jimmy. IronPython must be doing something really quite impressive here. :-) All the best, Michael We can look at this together on Monday unless you get to it sooner; I thought I knew how to use windbg but failed miserably at doing anything useful, so you'll have to help :) ~Jimmy On Apr 16, 2010, at 6:01 PM, Michael Foordfuzzy...@voidspace.org.uk wrote: Hello all, I'm still stuck on using the Silverlight 4 RichTextBox from IronPython. Unfortunately this is blocking our project. :-( Instantiating the RichTextBox directly or loading it from xaml fails. A wrapper class in C# that instantiates the RichTextBox and returns it to IronPython fails. A wrapper C# class that internally creates the RichTextBox but never returns it to IronPython *still* fails. Anyone got any suggestions for possible alternative approaches? My latest (failing) attempt. C#: public static class Foo { static RichTextEditor _editor = null; public static void Create(StackPanel panel) { _editor = new RichTextEditor(); panel.Children.Add(_editor); } } IronPython: clr.AddReference('SilverlightTextEditor, Version=1.0.0.0, Culture=neutral') canv = Canvas() xaml = Application.Current.LoadRootVisual(canv, app.xaml) from SilverlightTextEditor import Foo panel = StackPanel() xaml.Children.Add(panel) Foo.Create(panel) (Note that RichTextEditor is a standalone UserControl editor component built on top of the RichTextBox. It works fine from C#.) All the best, Michael Foord -- http://www.ironpythoninaction.com/ ___ 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 -- http://www.ironpythoninaction.com/ ___ Users mailing list Users@lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com -- http
Re: [IronPython] Still stuck on rich editor with IronPython and Silverlight
On 23/04/2010 00:10, Lukas Cenovsky wrote: I think when AppManifest.xaml is in app folder, Chiron won't generate it. That is correct - which means when we add (or remove) an assembly we have to also manually add it to the AppManifest because Chiron will no longer do it for us... Michael -- -- Lukáš Michael Foord wrote: Thanks very much - this is great news for us! I'm trying this now. Having to hardcode our AppManifest.xaml is unfortunate as we normally let Chiron generate this for us (whilst developing) - but I guess we could just recompile Chiron. Much appreciated, Michael On 22/04/2010 23:13, Jimmy Schementi wrote: AH! Thanks Dino! In the XAP file there is an AppManifest.xaml, which specifies a version number. Ours (both what Chiron generates and what's on gestalt.ironpython.net) is still set to a version of SL2, for Moonlight compat, which turns on quirks mode when running in SL3+. Changing Chiron.exe.config's AppManifest template (or your own copy of AppManifest.xaml) to have SL4's version number will run without quirks mode enabled, hopefully letting you use the richtextbox. For gestalt.ironpython.net, we will have multiple XAPs depending on what SL version you want to use, and the SL3 and 4 XAPs will have updates version numbers. Michael, let me know how this works out for you. ~Jimmy On Apr 22, 2010, at 1:11 PM, Dino Viehlanddi...@microsoft.com wrote: Ok, I know what's going on here, but I don't know the exact solution. I'm hoping one of you two know the solution. The good news is there's no bug, the rich text box isn't supposed to work! :) What's going on is that quirks mode is disabling the creation of the rich text box. This appears to be due to a version check against the version that's coming from the XAP. So I guess fixing some Silverlight ' version specified in the XAP file will fix this - I don't know if that's a XAP being generated by Chiron or if it's something on gestalt.ironpython.net. -Original Message- From: users-boun...@lists.ironpython.com [mailto:users- boun...@lists.ironpython.com] On Behalf Of Michael Foord Sent: Friday, April 16, 2010 6:21 PM To: Discussion of IronPython Cc: Jimmy Schementi Subject: Re: [IronPython] Still stuck on rich editor with IronPython and Silverlight On 17/04/2010 03:19, Jimmy Schementi wrote: Michael, let's get Dino in on this ... Dino, This seems like our fault, but I'm not savvy enough to track it down or verify my claim. Seems like it doesn't work regardless of invoking via reflection or ref.emit code; calling it's constructor 10,000 times still gave the same result. As Michael said, doing anything with RichTextBox fails when invoked from IronPython, but works fine when invoked without IronPython on the stack (pure C# app, for example). I'm amazed that it fails when *called* from C#, meaning that IronPython is doing something to make statically compiled code fail. Thanks for looking at this Jimmy. IronPython must be doing something really quite impressive here. :-) All the best, Michael We can look at this together on Monday unless you get to it sooner; I thought I knew how to use windbg but failed miserably at doing anything useful, so you'll have to help :) ~Jimmy On Apr 16, 2010, at 6:01 PM, Michael Foordfuzzy...@voidspace.org.uk wrote: Hello all, I'm still stuck on using the Silverlight 4 RichTextBox from IronPython. Unfortunately this is blocking our project. :-( Instantiating the RichTextBox directly or loading it from xaml fails. A wrapper class in C# that instantiates the RichTextBox and returns it to IronPython fails. A wrapper C# class that internally creates the RichTextBox but never returns it to IronPython *still* fails. Anyone got any suggestions for possible alternative approaches? My latest (failing) attempt. C#: public static class Foo { static RichTextEditor _editor = null; public static void Create(StackPanel panel) { _editor = new RichTextEditor(); panel.Children.Add(_editor); } } IronPython: clr.AddReference('SilverlightTextEditor, Version=1.0.0.0, Culture=neutral') canv = Canvas() xaml = Application.Current.LoadRootVisual(canv, app.xaml) from SilverlightTextEditor import Foo panel = StackPanel() xaml.Children.Add(panel) Foo.Create(panel) (Note that RichTextEditor is a standalone UserControl editor component built on top of the RichTextBox. It works fine from C#.) All the best, Michael Foord -- http://www.ironpythoninaction.com/ ___ 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 -- http://www.ironpythoninaction.com/ ___ Users mailing list Users@lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users
Re: [IronPython] License change?
Personally I think the Microsoft Public License is a pretty good open source license and I'm not sure the confusion of *another* license change is worth it. My $0.02... All the best, Michael On 19/04/2010 23:55, Dino Viehland wrote: Hello IronPython community, As you probably know IronPython has a long history of releasing our source code under permissive licenses. Initially IronPython was released under a specific IronPython license which was quite similar to the Microsoft Public License (PS-Pl) we ship under today. We occasionally hear feedback, questions and a general lack of familiarity from you about the license that we use. And in several instances, we have been asked why we don't adopt a more popular license, such as the Apache 2.0 License. We are therefore considering switching our license to a well known permissive license which is more commonly used by open source projects. Currently we are considering the Apache License, Version 2.0. We'd like to hear your feedback before we make any decisions. Do you think adopting a more popular license, such as the Apache License, would be a good change for IronPython? ___ Users mailing list Users@lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com -- http://www.ironpythoninaction.com/ ___ Users mailing list Users@lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com
Re: [IronPython] License change?
On 20/04/2010 00:13, Jeff Hardy wrote: On Mon, Apr 19, 2010 at 3:58 PM, Michael Foord fuzzy...@voidspace.org.uk wrote: Personally I think the Microsoft Public License is a pretty good open source license and I'm not sure the confusion of *another* license change is worth it. My $0.02... I agree with Michael. I don't see a particular issue with the Ms-PL, and it's not a particularly long or complex licence - unlike Apache's. The fact that it contains 'MS' might scare some people off, but if they're not willing to read the actual terms of the licence and decide if it's acceptable, do we really care? And if they're scared off by 'MS' how likely are they to be using IronPython in the first place. Michael - Jeff ___ Users mailing list Users@lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com -- http://www.ironpythoninaction.com/ ___ Users mailing list Users@lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com
Re: [IronPython] IronPython 2.6.1 for .NET 4.0 RC targeting Silverlight
On 15/04/2010 00:53, Jimmy Schementi wrote: Did you see the report of my problem with the RichTextBox with IronPython 2.6.1 RC. Do you see the same problem? Yes, I can repro it using *both* IronPython binaries built against SL3 and SL4; it appears that the RichTextBox.ctor() fails to be called via reflection. We call via reflection in the interpreter first as an optimization, and then generate code to do the call; though it looks like both paths are failing. I’m looking into this … installing windbg on my new machine at the moment =P Thanks very much Jimmy. Do you want me to open a bug on codeplex to track this? In the meantime I'm writing some C# to instantiate a RichTextBox and return it to us. All the best, Michael Foord The person who started this thread reported not being able to reference the assemblies. Oh, I thought they were trying to add references to the .NET 4.0 built assemblies in a Silverlight project, which absolutely doesn’t work; you need to use a build for Silverlight. *From:* Michael Foord [mailto:fuzzy...@voidspace.org.uk] *Sent:* Wednesday, April 14, 2010 2:41 PM *To:* Discussion of IronPython *Cc:* Jimmy Schementi *Subject:* Re: [IronPython] IronPython 2.6.1 for .NET 4.0 RC targeting Silverlight On 14/04/2010 09:29, Jimmy Schementi wrote: [snip...] In general versions of IronPython built against (for example) Silverlight 2 *can* use features from Silverlight 3. (Try Python uses IronPython that was built against Silverlight 2 - but dynamically uses some Silverlight 3 APIs if they are available.) As Silverlight 4 includes a different version of the CLR - and not just different API sets - I guess it particularly makes a difference if you are compiling C# code that works with IronPython. Odd and annoying that it won't even add references to earlier versions though. Does *everything* need to be specially compiled to be used with .NET 4? The *current* Silverlight builds can use SL4 features; like webcam, etc. This is because IronPython calls .NET APIs dynamically. However, since the Silverlight 2 builds don't statically depend on any of the new APIs in the Silverlight 4, any CLR4 features that the compilers/libraries usually depend on in .NET 4 aren't available in Silverlight 4; that's what the Silverlight 4 build will do for you. Did you see the report of my problem with the RichTextBox with IronPython 2.6.1 RC. Do you see the same problem? With regard to adding references to assemblies; as long as the same APIs exist in both versions of Silverlight, it will work in both, regardless of which compiler you use. It's the same situation with different .NET versions. Did I miss something where someone reported not being able to do this? The person who started this thread reported not being able to reference the assemblies. All the best, Michael Foord ___ Users mailing list Users@lists.ironpython.com mailto:Users@lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com -- http://www.ironpythoninaction.com/ -- http://www.ironpythoninaction.com/ ___ Users mailing list Users@lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com
[IronPython] Still stuck on rich editor with IronPython and Silverlight
Hello all, I'm still stuck on using the Silverlight 4 RichTextBox from IronPython. Unfortunately this is blocking our project. :-( Instantiating the RichTextBox directly or loading it from xaml fails. A wrapper class in C# that instantiates the RichTextBox and returns it to IronPython fails. A wrapper C# class that internally creates the RichTextBox but never returns it to IronPython *still* fails. Anyone got any suggestions for possible alternative approaches? My latest (failing) attempt. C#: public static class Foo { static RichTextEditor _editor = null; public static void Create(StackPanel panel) { _editor = new RichTextEditor(); panel.Children.Add(_editor); } } IronPython: clr.AddReference('SilverlightTextEditor, Version=1.0.0.0, Culture=neutral') canv = Canvas() xaml = Application.Current.LoadRootVisual(canv, app.xaml) from SilverlightTextEditor import Foo panel = StackPanel() xaml.Children.Add(panel) Foo.Create(panel) (Note that RichTextEditor is a standalone UserControl editor component built on top of the RichTextBox. It works fine from C#.) All the best, Michael Foord -- http://www.ironpythoninaction.com/ ___ Users mailing list Users@lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com
Re: [IronPython] Still stuck on rich editor with IronPython and Silverlight
On 17/04/2010 03:19, Jimmy Schementi wrote: Michael, let's get Dino in on this ... Dino, This seems like our fault, but I'm not savvy enough to track it down or verify my claim. Seems like it doesn't work regardless of invoking via reflection or ref.emit code; calling it's constructor 10,000 times still gave the same result. As Michael said, doing anything with RichTextBox fails when invoked from IronPython, but works fine when invoked without IronPython on the stack (pure C# app, for example). I'm amazed that it fails when *called* from C#, meaning that IronPython is doing something to make statically compiled code fail. Thanks for looking at this Jimmy. IronPython must be doing something really quite impressive here. :-) All the best, Michael We can look at this together on Monday unless you get to it sooner; I thought I knew how to use windbg but failed miserably at doing anything useful, so you'll have to help :) ~Jimmy On Apr 16, 2010, at 6:01 PM, Michael Foordfuzzy...@voidspace.org.uk wrote: Hello all, I'm still stuck on using the Silverlight 4 RichTextBox from IronPython. Unfortunately this is blocking our project. :-( Instantiating the RichTextBox directly or loading it from xaml fails. A wrapper class in C# that instantiates the RichTextBox and returns it to IronPython fails. A wrapper C# class that internally creates the RichTextBox but never returns it to IronPython *still* fails. Anyone got any suggestions for possible alternative approaches? My latest (failing) attempt. C#: public static class Foo { static RichTextEditor _editor = null; public static void Create(StackPanel panel) { _editor = new RichTextEditor(); panel.Children.Add(_editor); } } IronPython: clr.AddReference('SilverlightTextEditor, Version=1.0.0.0, Culture=neutral') canv = Canvas() xaml = Application.Current.LoadRootVisual(canv, app.xaml) from SilverlightTextEditor import Foo panel = StackPanel() xaml.Children.Add(panel) Foo.Create(panel) (Note that RichTextEditor is a standalone UserControl editor component built on top of the RichTextBox. It works fine from C#.) All the best, Michael Foord -- http://www.ironpythoninaction.com/ ___ 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 -- http://www.ironpythoninaction.com/ ___ Users mailing list Users@lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com
Re: [IronPython] IronPython 2.6.1 for .NET 4.0 RC targeting Silverlight
On 14/04/2010 09:08, Jimmy Schementi wrote: Doesn't look like IronPython4.sln is there, so I stand corrected. Also, doesn't look like the IronRuby repo has the latest sources either; for some reason our external source repos main branches aren't as uptodate as their servicing branches. I'll make a private build for Silverlight 4 to unblock anyone wanting to start experimenting with It and IronPython until we start including those bits in the releases. This would be way better if we had a public daily build server, but that's a whole other issue :( I would very much like access to this to see if it fixes our problems with accessing some of the components that are new in Silverlight 4. Thanks Michael ~Jimmy On Apr 12, 2010, at 8:18 AM, David Matsondmat...@gmail.com wrote: Jimmy, I'm having trouble finding the source code for the 2.6.1 .NET 4.0 release on Codeplex. Can you point me to it? Thanks. On Sat, Apr 10, 2010 at 2:22 PM, Jimmy Schementi jimmy.scheme...@microsoft.com wrote: To embed IronPython (CLR2 SL build) in a Silverlight 4 app, you have to add a reference to Microsoft.Scripting.ExtensionAttribute.dll to make sure types defined in both System.Core.dll and Microsoft.Scripting.Core.dll are used from the latter assembly. Again, Keep in mind the dynamic type in C# won't work in this case; you'll need to build IronPython against SL4 from source to to get that functionality. Let me know if this works for you. ~Jimmy On Apr 9, 2010, at 3:46 PM, David Matsondmat...@gmail.com wrote: Just for clarity's sake here are the 5 warnings and 1 error I receive. Warning 1 The predefined type 'System.Runtime.CompilerServices.ExtensionAttribute' is defined in multiple assemblies in the global alias; using definition from 'c:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.0\Profile\Client\System.Core.dll' Warning 2 The predefined type 'System.Runtime.InteropServices.DefaultParameterValueAttribute' is defined in multiple assemblies in the global alias; using definition from 'c:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.0\Profile\Client\System.dll' Warning 3 The predefined type 'System.Runtime.CompilerServices.CallSiteBinder' is defined in multiple assemblies in the global alias; using definition from 'c:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.0\Profile\Client\System.Core.dll' Warning 4 The predefined type 'System.Runtime.CompilerServices.CallSite' is defined in multiple assemblies in the global alias; using definition from 'c:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.0\Profile\Client\System.Core.dll' Warning 5 The predefined type 'System.Runtime.CompilerServices.CallSite' is defined in multiple assemblies in the global alias; using definition from 'c:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.0\Profile\Client\System.Core.dll' Error 6 The type 'System.Dynamic.ExpandoObject' exists in both 'c:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.0\Profile\Client\System.Core.dll' and '\IronPythonDlls\Microsoft.Scripting.Core.dll' On Fri, Apr 9, 2010 at 4:40 PM, David Matsondmat...@gmail.com wrote: Jimmy, I was using the DLLs from the .NET 2.0 release and that worked fine albeit there are several warnings regarding types existing in both the .NET and the IronPython assemblies. However, I tried to use an ExpandoObject and now I get the error: The type 'System.Dynamic.ExpandoObject' exists in both 'c:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.0\Profile\Client\System.Core.dll' and '\IronPythonDlls\Microsoft.Scripting.Core.dll' On Fri, Apr 9, 2010 at 4:33 PM, Jimmy Schementi jimmy.scheme...@microsoft.com wrote: The MSI I downloaded from the link in my previous posts installs to the following: C:\Program Files (x86)\IronPython 2.6 for .NET 4.0 RC\ There is no Silverlight folder as there is in the 2.6.1 download for .NET 2.0. If I try to add the dlls in the root of that folder I get the following message: You can't add a reference to IronPython.dll as it was not built against the Silverlight runtime. Silverlight projects will only work with Silverlight assemblies. Am I missing something? Thanks for your help. Since the current stable version of Silverlight is Silverlight 3, which is a subset of .NET 3.5, we only include Silverlight binaries in the version of IronPython for .NET 2.0: http://ironpython.codeplex.com/releases/view/40144. When Silverlight 4 is considered the stable version, which is a subset of .NET 4, IronPython for .NET 4.0 will contain binaries build against Silverlight 4. Note that those Silverlight binaries will run on Silverlight 4, they just aren't built against Silverlight 4, so any .NET 4.0
Re: [IronPython] is the performance gap between C and CPython a decent comparision between the performance gap between C# and IronPython?
Hello Pablo, Python is an expressive and highly dynamic language. As such it is typically possible to achieve things in less lines of code and fewer layers of architecture when writing idiomatic Python as compared to idiomatic C#. With less code often comes better performance. This really has been my experience and that of many people switching from statically typed languages like C# and Java. *However*, if you transliterate C# code (particularly algorithmic code as used by most synthetic benchmarks) to the direct equivalent in IronPython you *will* see C# running considerably faster. The answer is three-fold: * You don't write the same code in C# and Python * With a less restrictive language and less verbose language you have *more time* for performance optimisation - the bottlenecks in even computationally expensive code is typically the *way* your algorithms are implemented and *not* the language used * With IronPython integrating with C# is almost absurdly easy - so moving your performance sensitive code into C# after appropriate profilling and prototyping in IronPython is not hard Choosing a programming language based on its perceived performance characteristics is a premature optimisation. All the best, Michael Foord On 14/04/2010 13:52, Pablo Dalmazzo wrote: Hi there, I was replied in one of my topics in StackOverflow that the gap performance between C with cPython is comparable with the performance gap between with C# with IronPython by some guy I dont know who he is. It could be a newbie, it could not. Now since the base language/platform are very differents my guess is his comparision is way off, but since I hadnt have time to take a look to the IronPython sourcecode at all, even if I want to do it soon, I have no idea if what he says has any sense or not. Now it's a known fact the gap between C and (c)Python is huge, is that a decent comparision of the level of performance difference between C# and IronPython? I think if it's not, someone should reply him with some technical(s) details why not, I was asked if that was true by a programmer friend and she didnt got much confidence in IronPython by reading that Greetings, Pablo Con Hotmail no pierdas tiempo. Organizá tus emails en carpetas y encontralos rápido. Conocé cómo http://www.descubrewindowslive.com/hotmail/organizacion.asp ___ Users mailing list Users@lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com -- http://www.ironpythoninaction.com/ ___ Users mailing list Users@lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com
Re: [IronPython] IronPython 2.6.1 for .NET 4.0 RC targeting Silverlight
On 14/04/2010 09:29, Jimmy Schementi wrote: [snip...] In general versions of IronPython built against (for example) Silverlight 2 *can* use features from Silverlight 3. (Try Python uses IronPython that was built against Silverlight 2 - but dynamically uses some Silverlight 3 APIs if they are available.) As Silverlight 4 includes a different version of the CLR - and not just different API sets - I guess it particularly makes a difference if you are compiling C# code that works with IronPython. Odd and annoying that it won't even add references to earlier versions though. Does *everything* need to be specially compiled to be used with .NET 4? The *current* Silverlight builds can use SL4 features; like webcam, etc. This is because IronPython calls .NET APIs dynamically. However, since the Silverlight 2 builds don't statically depend on any of the new APIs in the Silverlight 4, any CLR4 features that the compilers/libraries usually depend on in .NET 4 aren't available in Silverlight 4; that's what the Silverlight 4 build will do for you. Did you see the report of my problem with the RichTextBox with IronPython 2.6.1 RC. Do you see the same problem? With regard to adding references to assemblies; as long as the same APIs exist in both versions of Silverlight, it will work in both, regardless of which compiler you use. It's the same situation with different .NET versions. Did I miss something where someone reported not being able to do this? The person who started this thread reported not being able to reference the assemblies. All the best, Michael Foord ___ Users mailing list Users@lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com -- http://www.ironpythoninaction.com/ ___ Users mailing list Users@lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com
[IronPython] Silverlight 4 and RichTextBox
Hello all, I'm trying to use the new RichTextBox from Silverlight 4 with IronPython. I have IronPython 2.6.1 RC and Silverlight 4 RC installed (Windows). It fails with a SystemError: Specified method is not supported when instantiating the RichTextBox. The code is: from System.Windows import Application from System.Windows.Controls import Canvas, RichTextBox canvas = Canvas() text = RichTextBox() text.Text = 'Hello World from IronPython' canvas.Children.Add(text) Application.Current.RootVisual = canvas Any ideas? All the best, Michael Foord -- http://www.ironpythoninaction.com/ ___ Users mailing list Users@lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com
Re: [IronPython] Silverlight 4 and RichTextBox
On 12/04/2010 13:33, Michael Foord wrote: Hello all, I'm trying to use the new RichTextBox from Silverlight 4 with IronPython. I have IronPython 2.6.1 RC and Silverlight 4 RC installed (Windows). It fails with a SystemError: Specified method is not supported when instantiating the RichTextBox. If I attempt to create the RichTextBox from xaml instead of code the error is: SystemError: AG_E_UNKNOWN_ERROR [Line: 5 Position: 25] The xaml is: Canvas x:Class=System.Windows.Controls.Canvas xmlns=http://schemas.microsoft.com/client/2007; xmlns:x=http://schemas.microsoft.com/winfx/2006/xaml; RichTextBox x:Name=text / /Canvas All the best, Michael The code is: from System.Windows import Application from System.Windows.Controls import Canvas, RichTextBox canvas = Canvas() text = RichTextBox() text.Text = 'Hello World from IronPython' canvas.Children.Add(text) Application.Current.RootVisual = canvas Any ideas? All the best, Michael Foord -- http://www.ironpythoninaction.com/ ___ Users mailing list Users@lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com