[IronPython] SilverShell 0.6.1 Released - many "intellisense" fixes + all source
I'm trying to walk a fine line between spamming this list, and alerting the 200+ people who downloaded SilverShell 0.6.0 that there's an important new bugfix release. I put a lot of irritating flaws in the "intellisense" to rest, including a major issue with member completion that crept into 0.6.0 at the last minute. Had I known there was going to be such a response I think I would have tested it more thoroughly. As promised all source code is in this release. Please notify me of remaining bugs, either via email, or via the issue tracker on Google Code. Patches are most welcome. Thanks for downloading SilverShell! -Dan ___ Users mailing list Users@lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com
Re: [IronPython] SourceCodeKind.Statements versus SourceCodeKind.InteractiveCode
On Sat, Dec 6, 2008 at 6:33 PM, Jeff Slutter <[EMAIL PROTECTED]> wrote: > I'm working on getting an interactive script console into my > application. Information on how to do this is a bit hard to find but I > came across an app.py by Jim Hugunin showing how to do it with Silverlight. You may find http://code.google.com/p/silvershell/ to be of some value, specifically the code in engine.py -Dan ___ Users mailing list Users@lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com
Re: [IronPython] Examples_for_calling_IronPython_from_ C#
>>>Did you have a chance to do that? Not in terms of a blog post... But this example should demonstrate that public void InvokeInstance_Example() { ScriptEngine engine = _runtime.GetEngine("py"); ScriptScope scope = engine.CreateScope(); ObjectOperations operation = engine.CreateOperations(scope); string pyCode = @"class Foo(object): i = -1 def Bar(self): return i"; ScriptSource src = engine.CreateScriptSourceFromString(pyCode, SourceCodeKind.Statements); src.Execute(scope); object FooClass = scope.GetVariable("Foo"); object newObjectInstance = engine.Operations.CreateInstance(FooClass, new object[] { }); // create new FooClass var bar = engine.Operations.GetMember>(newObjectInstance, "Bar"); int n = bar(); Assert.AreEqual(-1, n); } Thanks Sesh -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of M. Whitener Sent: Saturday, December 06, 2008 6:40 PM To: Discussion of IronPython Subject: Re: [IronPython] Examples_for_calling_IronPython_from_ C# Sesh, after your changes (below), and replacing using System.Scripting with using Microsoft.Scripting it works! This is great. Thank you. You mentioned that planned to post some code showing how to call python class instance methods. Did you have a chance to do that? Thanks again! Original Message Subject: Re: [IronPython] Examples_for_calling_IronPython_from_ C# From: Seshadri Pillailokam Vijayaraghavan <[EMAIL PROTECTED]> Date: Sat, December 06, 2008 5:02 pm To: Discussion of IronPython See if this helps - http://blogs.msdn.com/seshadripv/archive/2008/06/30/how-to-invoke-a-python-function-from-c-using-the-dlr-hosting-api.aspx However, the sample will not compile as some of the runtime initialization APIs have changed since that sample was posted. To fix this replace the 'ScriptRuntime.Create()' in this line line - 'ScriptEngine pyEng = ScriptRuntime.Create().GetEngine("python");' with 'IronPython.Hosting.Python.CreateRuntime();'. The new line should look like ' ScriptEngine pyEng = IronPython.Hosting.Python.CreateRuntime().GetEngine("python");' Let me know if you have any questions or need some information on this. Thanks Sesh -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of M. Whitener Sent: Saturday, December 06, 2008 2:55 PM To: Users@lists.ironpython.com Subject: [IronPython] Examples for calling IronPython from C# Is there a good source of documentation on how to use functions and classes in an IronPython program from C#? I need info on how to do this using C# 3.0 or lower - in other words _not_ using C# 4.0 dynamic types. The only example I have found is a very incomplete one from Alex Turner given at PDC 2008. Thanks in advance. ___ 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 ___ Users mailing list Users@lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com
Re: [IronPython] Examples_for_calling_IronPython_fr om_ C#
Sesh, after your changes (below), and replacing using System.Scripting with using Microsoft.Scripting it works! This is great. Thank you. You mentioned that planned to post some code showing how to call python class instance methods. Did you have a chance to do that? Thanks again! Original Message Subject: Re: [IronPython] Examples_for_calling_IronPython_from_ C# From: Seshadri Pillailokam Vijayaraghavan <[EMAIL PROTECTED]> Date: Sat, December 06, 2008 5:02 pm To: Discussion of IronPython See if this helps - http://blogs.msdn.com/seshadripv/archive/2008/06/30/how-to-invoke-a-python-function-from-c-using-the-dlr-hosting-api.aspx However, the sample will not compile as some of the runtime initialization APIs have changed since that sample was posted. To fix this replace the 'ScriptRuntime.Create()' in this line line - 'ScriptEngine pyEng = ScriptRuntime.Create().GetEngine("python");' with 'IronPython.Hosting.Python.CreateRuntime();'. The new line should look like ' ScriptEngine pyEng = IronPython.Hosting.Python.CreateRuntime().GetEngine("python");' Let me know if you have any questions or need some information on this. Thanks Sesh -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of M. Whitener Sent: Saturday, December 06, 2008 2:55 PM To: Users@lists.ironpython.com Subject: [IronPython] Examples for calling IronPython from C# Is there a good source of documentation on how to use functions and classes in an IronPython program from C#? I need info on how to do this using C# 3.0 or lower - in other words _not_ using C# 4.0 dynamic types. The only example I have found is a very incomplete one from Alex Turner given at PDC 2008. Thanks in advance. ___ 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
Re: [IronPython] SourceCodeKind.Statements versus SourceCodeKind.InteractiveCode
This behavior is actually defined by CPython which specs interactive input as being: interactive_input ::= [stmt_list] NEWLINE | compound_stmt NEWLINE The stmt_list allows the semi-colon delinated lines and the compound_stmt allows a single statement. The idea here is that this is for a console input and that there really should be only one statement being entered at a time. We could de-couple the relationship between interactive code & printing expression statements though. Internally they're not really that related so it wouldn't be that hard to do. If that sounds like it'd help you (or if there's others that would like to see it) you could open a feature request on CodePlex. > -Original Message- > From: [EMAIL PROTECTED] [mailto:users- > [EMAIL PROTECTED] On Behalf Of Jeff Slutter > Sent: Saturday, December 06, 2008 3:33 PM > To: Discussion of IronPython > Subject: [IronPython] SourceCodeKind.Statements versus > SourceCodeKind.InteractiveCode > > I'm working on getting an interactive script console into my > application. Information on how to do this is a bit hard to find but I > came across an app.py by Jim Hugunin showing how to do it with > Silverlight. > > I based my C# app around that and have something working pretty well. > I'm always using SourceCodeKind.InteractiveCode when compiling the > source snippets and it works great. But there is a situation where it > doesn't do what I expect. > > If I pass in the following string: > > a = 10 + 3; > print(a); > > (note: two statements, separated with a newline) > > It will give me an error saying that the 'print' is an unexpected > token. > > If I pass in the following string: > > a = 10 + 3; print(a); > > It works as expected (printing out 13). > > It works fine if there are multiple lines for a statement like: > > if( a > 10 ): > print(a); > > If I use SourceCodeKind.Statements then all of the above works just > fine, but I don't get the nice things like the automatic print of the > returned value of the statement or the "_" variable. > > Is there a reason why InteractiveCode does things different like that? > I > want to give a consistent interface to my users and I think they would > expect that they can give two statements at once (especially if they > can > do it on the same line). > > I can work around this to get what I want by building up my buffer one > line at a time and testing to see if it is a "complete" statement and > executing that, then continuing to feed in the next line, etc. But, if > I > don't have to, I don't want to do that. > > Any ideas? > > Thanks > Jeff > > ___ > 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
[IronPython] SourceCodeKind.Statements versus SourceCodeKind.InteractiveCode
I'm working on getting an interactive script console into my application. Information on how to do this is a bit hard to find but I came across an app.py by Jim Hugunin showing how to do it with Silverlight. I based my C# app around that and have something working pretty well. I'm always using SourceCodeKind.InteractiveCode when compiling the source snippets and it works great. But there is a situation where it doesn't do what I expect. If I pass in the following string: a = 10 + 3; print(a); (note: two statements, separated with a newline) It will give me an error saying that the 'print' is an unexpected token. If I pass in the following string: a = 10 + 3; print(a); It works as expected (printing out 13). It works fine if there are multiple lines for a statement like: if( a > 10 ): print(a); If I use SourceCodeKind.Statements then all of the above works just fine, but I don't get the nice things like the automatic print of the returned value of the statement or the "_" variable. Is there a reason why InteractiveCode does things different like that? I want to give a consistent interface to my users and I think they would expect that they can give two statements at once (especially if they can do it on the same line). I can work around this to get what I want by building up my buffer one line at a time and testing to see if it is a "complete" statement and executing that, then continuing to feed in the next line, etc. But, if I don't have to, I don't want to do that. Any ideas? Thanks Jeff ___ Users mailing list Users@lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com
Re: [IronPython] Examples for calling IronPython from C#
See if this helps - http://blogs.msdn.com/seshadripv/archive/2008/06/30/how-to-invoke-a-python-function-from-c-using-the-dlr-hosting-api.aspx However, the sample will not compile as some of the runtime initialization APIs have changed since that sample was posted. To fix this replace the 'ScriptRuntime.Create()' in this line line - 'ScriptEngine pyEng = ScriptRuntime.Create().GetEngine("python");' with 'IronPython.Hosting.Python.CreateRuntime();'. The new line should look like ' ScriptEngine pyEng = IronPython.Hosting.Python.CreateRuntime().GetEngine("python");' Let me know if you have any questions or need some information on this. Thanks Sesh -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of M. Whitener Sent: Saturday, December 06, 2008 2:55 PM To: Users@lists.ironpython.com Subject: [IronPython] Examples for calling IronPython from C# Is there a good source of documentation on how to use functions and classes in an IronPython program from C#? I need info on how to do this using C# 3.0 or lower - in other words _not_ using C# 4.0 dynamic types. The only example I have found is a very incomplete one from Alex Turner given at PDC 2008. Thanks in advance. ___ 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
[IronPython] Examples for calling IronPython from C#
Is there a good source of documentation on how to use functions and classes in an IronPython program from C#? I need info on how to do this using C# 3.0 or lower - in other words _not_ using C# 4.0 dynamic types. The only example I have found is a very incomplete one from Alex Turner given at PDC 2008. Thanks in advance. ___ Users mailing list Users@lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com
Re: [IronPython] CP #20099: Stack Overflow using super() in dict subclass
The immediate question would be does fixing this unblock all other Django issues? If there's going to be a long tail of other bugs then it'd be better to just fix them all for 2.0.1. If you want to try this out the fix is easy, in PythonDictionary.cs replace the line: this[(object)null] = value; with: _storage.Add(null, value); You'll probably find that alone isn't sufficient - the getter probably needs a similar change where it does the same thing as this[object key]. > -Original Message- > From: [EMAIL PROTECTED] [mailto:users- > [EMAIL PROTECTED] On Behalf Of Jeff Hardy > Sent: Saturday, December 06, 2008 12:57 PM > To: Discussion of IronPython > Subject: [IronPython] CP #20099: Stack Overflow using super() in dict > subclass > > Hi, > Django's MultiValueDict is a key piece of its URL routing, and it > appears to be broken on IronPython 2.0RC2 (and RC1) when using a key > of None. See > http://www.codeplex.com/IronPython/WorkItem/View.aspx?WorkItemId=20099 > for details. > > I hate to be needy with a release so close, but is there any chance of > fixing this for 2.0? > > - Jeff > ___ > Users mailing list > Users@lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com ___ Users mailing list Users@lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com
Re: [IronPython] NWSGI 0.7 released
Jeff Hardy wrote: On Sat, Dec 6, 2008 at 10:20 AM, Michael Foord <[EMAIL PROTECTED]> wrote: The Django guys are very interested in getting it to work on IronPython and would be open to discussion as to ways round problem. For example - how to resolve the str / unicode issue (perhaps patching in a compatible 'bytes' like implementation rather than fixing on str as a way of deciding to serve binary data). While that's great to hear, there's a long way to go before that becomes the biggest issue. There are still some annoying IPy bugs that break more fundamental things (i.e. MultiValueDict is currently broken). I haven't even run into the str/unicode problem yet, but it's certainly good to keep in mind. Cool. Would be great to have a reprise of what the current blockers are. Michael - Jeff All the best, Michael Foord It is on my list of things to get working (along with Trac, which will be much harder), but it's that pesky time thing, as always :). - Jeff On Fri, Dec 5, 2008 at 1:11 AM, Miha Valencic <[EMAIL PROTECTED]> wrote: Jeff, do you have any info on whether Django works with this setup? Thanks, Miha. 2008/12/5 Jeff Hardy <[EMAIL PROTECTED]> NWSGI 0.7 is now available. This version adds support for ASP.NET sessions, fixes Unicode handling, and adds support for wildcard mappings. It is available at http://www.codeplex.com/NWSGI/Release/ProjectReleases.aspx?ReleaseId=20189. ___ 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 ___ 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 ___ Users mailing list Users@lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com
[IronPython] CP #20099: Stack Overflow using super() in dict subclass
Hi, Django's MultiValueDict is a key piece of its URL routing, and it appears to be broken on IronPython 2.0RC2 (and RC1) when using a key of None. See http://www.codeplex.com/IronPython/WorkItem/View.aspx?WorkItemId=20099 for details. I hate to be needy with a release so close, but is there any chance of fixing this for 2.0? - Jeff ___ Users mailing list Users@lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com
Re: [IronPython] NWSGI 0.7 released
On Sat, Dec 6, 2008 at 10:20 AM, Michael Foord <[EMAIL PROTECTED]> wrote: > The Django guys are very interested in getting it to work on IronPython and > would be open to discussion as to ways round problem. For example - how to > resolve the str / unicode issue (perhaps patching in a compatible 'bytes' > like implementation rather than fixing on str as a way of deciding to serve > binary data). While that's great to hear, there's a long way to go before that becomes the biggest issue. There are still some annoying IPy bugs that break more fundamental things (i.e. MultiValueDict is currently broken). I haven't even run into the str/unicode problem yet, but it's certainly good to keep in mind. - Jeff > > All the best, > > Michael Foord > >> It is on my list of things to get working (along with Trac, which will >> be much harder), but it's that pesky time thing, as always :). >> >> - Jeff >> >> On Fri, Dec 5, 2008 at 1:11 AM, Miha Valencic <[EMAIL PROTECTED]> >> wrote: >> >>> >>> Jeff, do you have any info on whether Django works with this setup? >>> >>> Thanks, >>> Miha. >>> >>> 2008/12/5 Jeff Hardy <[EMAIL PROTECTED]> >>> NWSGI 0.7 is now available. This version adds support for ASP.NET sessions, fixes Unicode handling, and adds support for wildcard mappings. It is available at http://www.codeplex.com/NWSGI/Release/ProjectReleases.aspx?ReleaseId=20189. >>> >>> ___ >>> 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 > > > ___ > Users mailing list > Users@lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > ___ Users mailing list Users@lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com
Re: [IronPython] NWSGI 0.7 released
Jeff Hardy wrote: Hi Miha, As Dan said, there are issues with str == unicode (although there is a Jython branch of Django that I should look into). There are also some other issues that seem to shift - trying to hit two moving targets makes tracking them difficult. For very simple stuff, Django might work, but I wouldn't expect it to do too much. The Django guys are very interested in getting it to work on IronPython and would be open to discussion as to ways round problem. For example - how to resolve the str / unicode issue (perhaps patching in a compatible 'bytes' like implementation rather than fixing on str as a way of deciding to serve binary data). All the best, Michael Foord It is on my list of things to get working (along with Trac, which will be much harder), but it's that pesky time thing, as always :). - Jeff On Fri, Dec 5, 2008 at 1:11 AM, Miha Valencic <[EMAIL PROTECTED]> wrote: Jeff, do you have any info on whether Django works with this setup? Thanks, Miha. 2008/12/5 Jeff Hardy <[EMAIL PROTECTED]> NWSGI 0.7 is now available. This version adds support for ASP.NET sessions, fixes Unicode handling, and adds support for wildcard mappings. It is available at http://www.codeplex.com/NWSGI/Release/ProjectReleases.aspx?ReleaseId=20189. ___ 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 ___ Users mailing list Users@lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com
Re: [IronPython] Welcome David DiCato
Samo Arigato, David DiCato (and Dino and Curt and Jim H. too) On Fri, Dec 5, 2008 at 7:42 PM, Dan Eloff <[EMAIL PROTECTED]> wrote: > Welcome David. It is heartening to see that even in these difficult > economic times Microsoft is allocating more resources to dynamic > languages. > > Best wishes to you in your new job. > > -Dan > ___ > Users mailing list > Users@lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > ___ Users mailing list Users@lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com
Re: [IronPython] NWSGI 0.7 released
Hi Miha, As Dan said, there are issues with str == unicode (although there is a Jython branch of Django that I should look into). There are also some other issues that seem to shift - trying to hit two moving targets makes tracking them difficult. For very simple stuff, Django might work, but I wouldn't expect it to do too much. It is on my list of things to get working (along with Trac, which will be much harder), but it's that pesky time thing, as always :). - Jeff On Fri, Dec 5, 2008 at 1:11 AM, Miha Valencic <[EMAIL PROTECTED]> wrote: > Jeff, do you have any info on whether Django works with this setup? > > Thanks, > Miha. > > 2008/12/5 Jeff Hardy <[EMAIL PROTECTED]> >> >> NWSGI 0.7 is now available. This version adds support for ASP.NET >> sessions, fixes Unicode handling, and adds support for wildcard >> mappings. It is available at >> >> http://www.codeplex.com/NWSGI/Release/ProjectReleases.aspx?ReleaseId=20189. >> > > > ___ > 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
[IronPython] Last source drop was Nov 30. Is something broken?
Just eager to get my hands on the latest code. -Dan ___ Users mailing list Users@lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com