[IronPython] ironpython compared to powershell
Hi everyone! I would like you ask this question that I seem not to get an answer for anywhere. What is the advantage of using ironpython compared to using only powershell? Or is it just a personal choice which one you like the best? Best Regards, Joakim ___ Users mailing list Users@lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com
Re: [IronPython] ironpython compared to powershell
Nicer syntax On Tue, May 26, 2009 at 4:58 PM, jocke khazad khaz...@gmail.com wrote: Hi everyone! I would like you ask this question that I seem not to get an answer for anywhere. What is the advantage of using ironpython compared to using only powershell? Or is it just a personal choice which one you like the best? Best Regards, Joakim ___ Users mailing list Users@lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com -- nomadlife.org ___ Users mailing list Users@lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com
Re: [IronPython] IPython is breathing but there's a compile() problem
This is probably a dup of 12907 http://ironpython.codeplex.com/WorkItem/View.aspx?WorkItemId=12907 That being said the more test cases for this the better - this option isn't really documented. Also if anyone can provide insight into exactly how this is supposed to behave that'd be great. But my guess is that we'll have a tail of bugs around this until we can nail down the behavior and get it right. Anyway, I'll take a look at fixing the existing issues here. Wanting to implement a REPL from Python seems like it's the thing everyone likes to try :) From: users-boun...@lists.ironpython.com [mailto:users-boun...@lists.ironpython.com] On Behalf Of Mike Krell Sent: Monday, May 25, 2009 10:00 AM To: Discussion of IronPython Subject: [IronPython] IPython is breathing but there's a compile() problem Now that 2.6B1 has frames support, I've started playing with IronPython under IPython again. I've managed to get a command prompt up (some modules are missing, but the only crucial one is codeop, which I stole from the standard distribution). However, there's a problem with entering multiline code snippets interactively. With CPython, this looks like: In [21]: if 1: : if 1: : (The indentation looks wrong without a fixed-width font, but you get the idea.) With IronPython, the second if 1: line blows up with a syntax error. This boils down to a difference in the way the compile() builtin works as used by the codeop module. I've written this up as a bug at codeplex. Please vote for the bug here: http://ironpython.codeplex.com/WorkItem/View.aspx?WorkItemId=22692 It would be awesome if we could have a good IronPython + IPython story before 2.6 is released! Below are more details about the problem as described in the bug description. Mike bug description at codeplex follows compile() behaves differently than in CPython in the presence of incomplete multiline code snippets. Fixing this incompatiblity is necessary for running IronPython under IPython. Here is a sample program illustrating the problem. The program is a modification of the code used in the standard codeop module by IPython to determine when to provide a continuation prompt for a multiline snippet. def testcompile(source, flags): err = err1 = err2 = None code = code1 = code2 = None try: code = compile(source, dummy, single, flags, 1) except SyntaxError, err: pass try: code1 = compile(source + \n, dummy, single, flags, 1) except SyntaxError, err1: pass try: code2 = compile(source + \n\n, dummy, single, flags, 1) except SyntaxError, err2: pass print for source = '%s' and flags = %d % (source, flags), if code: print Syntax valid elif not code1 and repr(err1) == repr(err2): print Syntax error! print print err1:, repr(err1) print err2:, repr(err2) else: print Continue on next line print print err1:, repr(err1) print err2:, repr(err2) print # 0x200 is PyCF_DONT_IMPLY_DEDENT testcompile(if 1:, 0x200) testcompile(if 1:, 0) testcompile(if 1:\n if 1:, 0x200) testcompile(if 1:\n if 1:, 0) Under CPython (2.6.1) the output is: for source = 'if 1:' and flags = 512 Continue on next line err1: SyntaxError('unexpected EOF while parsing', ('dummy', 1, 6, 'if 1:\n')) err2: IndentationError('expected an indented block', ('dummy', 2, 1, '\n')) for source = 'if 1:' and flags = 0 Continue on next line err1: SyntaxError('unexpected EOF while parsing', ('dummy', 1, 6, 'if 1:\n')) err2: IndentationError('expected an indented block', ('dummy', 2, 1, '\n')) for source = 'if 1: if 1:' and flags = 512 Continue on next line err1: IndentationError('expected an indented block', ('dummy', 2, 8, ' if 1:\n')) err2: IndentationError('expected an indented block', ('dummy', 3, 1, '\n')) for source = 'if 1: if 1:' and flags = 0 Continue on next line err1: IndentationError('expected an indented block', ('dummy', 2, 8, ' if 1:\n')) err2: IndentationError('expected an indented block', ('dummy', 3, 1, '\n')) In all cases the code correctly outputs Continue on next line since both snippets are incomplete but otherwise valid python. For IronPython 2.6 Beta 1 the output is: for source = 'if 1:' and flags = 512 Continue on next line err1: IndentationError(unexpected token 'eof', ('dummy', 2, 1, '')) err2: IndentationError(unexpected token 'eof', ('dummy', 3, 1,
Re: [IronPython] IPython is breathing but there's a compile() problem
On Tue, May 26, 2009 at 10:50 AM, Michael Foord fuzzy...@voidspace.org.ukwrote I wonder if it isn't in fact caused by the fact that the repr of an IronPython syntax error doesn't change if the you add new lines to the source code you are compiling. Yes, in this case that is the crux of the issue. Mike ___ Users mailing list Users@lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com
Re: [IronPython] ironpython compared to powershell
I am prejudiced. Several years ago, I was looking for a copy of perl which would run on Windows, because I needed a better scripting language than a .BAT file could give. (This was using Windows 2000.) While searching the Internet, I tripped across a comment something like: Why would anyone learn perl when python is available? That was the first time I had ever heard of python. I looked it up... I have made very little use of any other language since that day. Python has IMHO the best syntax of any programming language I have ever used -- and I have used plenty. Python is also one of the most versatile languages I have seen. For example... I was given the task of keeping several users from attempting to update the same drawing (autocad file) simultaneously, so I needed a lightweight version control system for non-text files. I wrote it in Python. It was too hard for computer illiterate users, so I added a GUI front end with one of the GUI tool kits available (wyPython). I had need of a similar system for another application, so I changed the file structure it used (easy with the os.path module). I needed it to work across the Internet, so I changed the Windows copy commands to ftp using a standard Python module. I needed to share the data with some Linux systems, so copied the Python source to Ubuntu and ran it. I had to make about three changes in the source to make it work on either operating system. (Note: this was CPython, not IronPython. IronPython is catching up.) So you can learn a scripting language which is limited in scope and is supported by the richest company in the world (this week at least), and which therefore will have lots of job openings. or... You can learn a scripting language which is easy and fun and open source and has an active development community worldwide and can also be used for HUGE projects and web services, but you will have a hard time selling it in some cases. -- Vernon Cole On Tue, May 26, 2009 at 7:58 AM, jocke khazad khaz...@gmail.com wrote: Hi everyone! I would like you ask this question that I seem not to get an answer for anywhere. What is the advantage of using ironpython compared to using only powershell? Or is it just a personal choice which one you like the best? Best Regards, Joakim ___ 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] ironpython compared to powershell
So pretty much, there is no real advantage of using python more then in a religious point of view? Can you code powershell to control/automatise linux servers for example? An advantage could be to work with a language that works on any platform. On Tue, May 26, 2009 at 9:02 PM, Vernon Cole vernondc...@gmail.com wrote: I am prejudiced. Several years ago, I was looking for a copy of perl which would run on Windows, because I needed a better scripting language than a .BAT file could give. (This was using Windows 2000.) While searching the Internet, I tripped across a comment something like: Why would anyone learn perl when python is available? That was the first time I had ever heard of python. I looked it up... I have made very little use of any other language since that day. Python has IMHO the best syntax of any programming language I have ever used -- and I have used plenty. Python is also one of the most versatile languages I have seen. For example... I was given the task of keeping several users from attempting to update the same drawing (autocad file) simultaneously, so I needed a lightweight version control system for non-text files. I wrote it in Python. It was too hard for computer illiterate users, so I added a GUI front end with one of the GUI tool kits available (wyPython). I had need of a similar system for another application, so I changed the file structure it used (easy with the os.path module). I needed it to work across the Internet, so I changed the Windows copy commands to ftp using a standard Python module. I needed to share the data with some Linux systems, so copied the Python source to Ubuntu and ran it. I had to make about three changes in the source to make it work on either operating system. (Note: this was CPython, not IronPython. IronPython is catching up.) So you can learn a scripting language which is limited in scope and is supported by the richest company in the world (this week at least), and which therefore will have lots of job openings. or... You can learn a scripting language which is easy and fun and open source and has an active development community worldwide and can also be used for HUGE projects and web services, but you will have a hard time selling it in some cases. -- Vernon Cole On Tue, May 26, 2009 at 7:58 AM, jocke khazad khaz...@gmail.com wrote: Hi everyone! I would like you ask this question that I seem not to get an answer for anywhere. What is the advantage of using ironpython compared to using only powershell? Or is it just a personal choice which one you like the best? Best Regards, Joakim ___ 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] ironpython compared to powershell
On Tue, May 26, 2009 at 14:16, jocke khazad khaz...@gmail.com wrote: So pretty much, there is no real advantage of using python more then in a religious point of view? Can you code powershell to control/automatise linux servers for example? An advantage could be to work with a language that works on any platform. Python/IronPython is a multi-paradigm programming language. Powershell is a scripting language to work inside the Powershell command line shell. They both serve their purpose, but there are innumerable advantages to using a programming language like Python/IronPython depending on what you want to do. Controlling a Linux server is a very vague usage so I can't speak to that specific topic, so this doesn't really answer much. As far as working on any platform, IronPython works on Windows along with platforms which run Mono (Linux included), which may suit you. ___ Users mailing list Users@lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com
Re: [IronPython] ironpython compared to powershell
Ironpython is a general purpose programming language whereas Powershell is primarily to replace the 'command prompt', batch file and vbscript within Windows system administration, though it appears in SQL Server 2008. Both have good .Net integration so you you could administer a network with either. Ironically IronPython is far more easy to deploy (xcopy) than Powershell which is a key factor in big tightly controlled networks. Cheers, Davy Mitchell -- Davy Stuff - http://daftspaniel.blogspot.com Geeky Stuff - http://daftpython.blogspot.com Davy's Ironpython Editor - http://code.google.com/p/davysironpythoneditor/ ___ Users mailing list Users@lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com
[IronPython] [ATTN] ASP.NET and IronPython 2.6 Beta 1
Download Now http://aspnet.codeplex.com/Release/ProjectReleases.aspx?ReleaseId=17613#DownloadId=69511 This release is compatible with IronPython 2.6 Beta 1http://ironpython.codeplex.com/Release/ProjectReleases.aspx?ReleaseId=25126. Currently it does not include Language Services Support and project templates. To create a new IronPython ASP.NET WebForms project, simply copy the examples\hello-webforms to a new directory and rename the directory to your liking. A redistributed copy of IronPython 2.6 Beta 1 can be found in the bin directory; all files except Microsoft.Web.Scripting.dll, the IronPython ASP.NET integration, are from the IronPython 2.6 Beta 1 release. Included in this release are two WebForms examples that are written in IronPython: hello-webforms and album-handler, which can be found in the examples directory. hello-webforms is a simple web application that shows PostBack handling, and album-handler is a larger web application that creates a photo album from a directory of images and generates thumbnails for them on the fly. Release notes: http://aspnet.codeplex.com/Wiki/View.aspx?title=Dynamic%20Language%20Support Release page: http://aspnet.codeplex.com/Release/ProjectReleases.aspx?ReleaseId=17613 ___ Users mailing list Users@lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com
Re: [IronPython] [ATTN] ASP.NET and IronPython 2.6 Beta 1
NICE! Just a thought, but maybe on the download page you should put a link that says IronPython for ASP.Net Binaries or something. Right now the link to sample is kind of confusing. The way I read sample is that it will just contain source code, not actual binaries. Thanks, Adam Adam Brand SilverKey Technologies From: users-boun...@lists.ironpython.com [mailto:users-boun...@lists.ironpython.com] On Behalf Of Jimmy Schementi Sent: Tuesday, May 26, 2009 12:39 PM To: Discussion of IronPython Subject: [IronPython] [ATTN] ASP.NET and IronPython 2.6 Beta 1 Download Now http://aspnet.codeplex.com/Release/ProjectReleases.aspx?ReleaseId=17613#Down loadId=69511 This release is compatible with IronPython http://ironpython.codeplex.com/Release/ProjectReleases.aspx?ReleaseId=25126 2.6 Beta 1. Currently it does not include Language Services Support and project templates. To create a new IronPython ASP.NET WebForms project, simply copy the examples\hello-webforms to a new directory and rename the directory to your liking. A redistributed copy of IronPython 2.6 Beta 1 can be found in the bin directory; all files except Microsoft.Web.Scripting.dll, the IronPython ASP.NET integration, are from the IronPython 2.6 Beta 1 release. Included in this release are two WebForms examples that are written in IronPython: hello-webforms and album-handler, which can be found in the examples directory. hello-webforms is a simple web application that shows PostBack handling, and album-handler is a larger web application that creates a photo album from a directory of images and generates thumbnails for them on the fly. Release notes: http://aspnet.codeplex.com/Wiki/View.aspx?title=Dynamic%20Language%20Support Release page: http://aspnet.codeplex.com/Release/ProjectReleases.aspx?ReleaseId=17613 ___ Users mailing list Users@lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com
Re: [IronPython] [ATTN] ASP.NET and IronPython 2.6 Beta 1
Yay ! I had planned to sleep early :) (It's 11 PM Cairo time) This is awesome, thank you so much. Finally I can say goodbye to Microsoft.Scripting.Vestigial and remove my custom built IP 2.0. Dody G. On Tue, May 26, 2009 at 10:39 PM, Jimmy Schementi jimmy.scheme...@microsoft.com wrote: *Download Now* http://aspnet.codeplex.com/Release/ProjectReleases.aspx?ReleaseId=17613#DownloadId=69511 This release is compatible with IronPython 2.6 Beta 1http://ironpython.codeplex.com/Release/ProjectReleases.aspx?ReleaseId=25126. Currently it does not include Language Services Support and project templates. To create a new IronPython ASP.NET WebForms project, simply copy the “examples\hello-webforms” to a new directory and rename the directory to your liking. A redistributed copy of IronPython 2.6 Beta 1 can be found in the “bin” directory; all files except Microsoft.Web.Scripting.dll, the IronPython ASP.NET integration, are from the IronPython 2.6 Beta 1 release. Included in this release are two WebForms examples that are written in IronPython: “hello-webforms” and “album-handler”, which can be found in the “examples” directory. “hello-webforms” is a simple web application that shows PostBack handling, and “album-handler” is a larger web application that creates a photo album from a directory of images and generates thumbnails for them on the fly. Release notes: http://aspnet.codeplex.com/Wiki/View.aspx?title=Dynamic%20Language%20Support Release page: http://aspnet.codeplex.com/Release/ProjectReleases.aspx?ReleaseId=17613 ___ Users mailing list Users@lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com -- nomadlife.org ___ Users mailing list Users@lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com
[IronPython] 'Python' does not exist in current context
Trying to embed IPy in C#, and after digging all over the web and the archives of this list, I can't figure out why the Python object won't load. Here is the basic line where it goes wrong: ScriptEngine eng = Python.CreateEngine(); All the other typical Objects are loading fine, just not the Python object. I've tried a handful of different assemblies, and still nothing works. The embedding example from Iron Python in Action DOES work though, and I added assembly reflection code and can see that those assemblies were locale to that solutions folder. EZ quick fix, I thought was to copy those older assemblies over into the Iron Python assemblies (after backing them up). But still no luck. Pretty new to .NET and Visual Studio, but been dealing with CPython for years. Anyone have any ideas on what I could be doing wrong? Running Vis Studio 2008, Iron Python Studio Integrated, .NET 3.5 ___ Users mailing list Users@lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com
Re: [IronPython] 'Python' does not exist in current context
Make sure you refer to the following assemblies. Microsoft.Scripting.dllMicrosoft.Scripting.Core.dll IronPython.dll IronPython.Modules.dll On Tue, May 26, 2009 at 11:47 PM, Justin Regele jregel...@gmail.com wrote: Trying to embed IPy in C#, and after digging all over the web and the archives of this list, I can't figure out why the Python object won't load. Here is the basic line where it goes wrong: ScriptEngine eng = Python.CreateEngine(); All the other typical Objects are loading fine, just not the Python object. I've tried a handful of different assemblies, and still nothing works. The embedding example from Iron Python in Action DOES work though, and I added assembly reflection code and can see that those assemblies were locale to that solutions folder. EZ quick fix, I thought was to copy those older assemblies over into the Iron Python assemblies (after backing them up). But still no luck. Pretty new to .NET and Visual Studio, but been dealing with CPython for years. Anyone have any ideas on what I could be doing wrong? Running Vis Studio 2008, Iron Python Studio Integrated, .NET 3.5 ___ Users mailing list Users@lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com -- nomadlife.org ___ Users mailing list Users@lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com
Re: [IronPython] [ATTN] ASP.NET and IronPython 2.6 Beta 1
Alright, time to file bug report :) ViewState in user control fails to work. This is how to reproduce it 1. I run the example hello-webforms example. 2. I added a user control called test.ascx 3. The content of test.ascx.py as follows: def Page_Load(sender, e): lblWarning.Text = Hello World Response.Write(From Response) ViewState[test] = xx 4. It will produce the following error (cannot access protected member ViewState without a python subclass of ScriptUserControl) *Parser Error Message: *cannot access protected member ViewState without a python subclass of ScriptUserControl *Source Error:* Line 2: lblWarning.Text = Hello World Line 3: Response.Write(From Response)Line 4: ViewState[test] = xxLine 5: *Source File: */test.ascx.py*Line: *4 On Tue, May 26, 2009 at 11:25 PM, Dody Gunawinata empirebuil...@gmail.comwrote: Yay ! I had planned to sleep early :) (It's 11 PM Cairo time) This is awesome, thank you so much. Finally I can say goodbye to Microsoft.Scripting.Vestigial and remove my custom built IP 2.0. Dody G. On Tue, May 26, 2009 at 10:39 PM, Jimmy Schementi jimmy.scheme...@microsoft.com wrote: *Download Now* http://aspnet.codeplex.com/Release/ProjectReleases.aspx?ReleaseId=17613#DownloadId=69511 This release is compatible with IronPython 2.6 Beta 1http://ironpython.codeplex.com/Release/ProjectReleases.aspx?ReleaseId=25126. Currently it does not include Language Services Support and project templates. To create a new IronPython ASP.NET WebForms project, simply copy the “examples\hello-webforms” to a new directory and rename the directory to your liking. A redistributed copy of IronPython 2.6 Beta 1 can be found in the “bin” directory; all files except Microsoft.Web.Scripting.dll, the IronPython ASP.NET integration, are from the IronPython 2.6 Beta 1 release. Included in this release are two WebForms examples that are written in IronPython: “hello-webforms” and “album-handler”, which can be found in the “examples” directory. “hello-webforms” is a simple web application that shows PostBack handling, and “album-handler” is a larger web application that creates a photo album from a directory of images and generates thumbnails for them on the fly. Release notes: http://aspnet.codeplex.com/Wiki/View.aspx?title=Dynamic%20Language%20Support Release page: http://aspnet.codeplex.com/Release/ProjectReleases.aspx?ReleaseId=17613 ___ Users mailing list Users@lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com -- nomadlife.org -- nomadlife.org ___ Users mailing list Users@lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com
Re: [IronPython] 'Python' does not exist in current context
thanks. that did the trick. it was the one I assumed wasn't needed, since modules sounded like it would be, well, just python modules. On Tue, May 26, 2009 at 2:00 PM, Dody Gunawinata empirebuil...@gmail.comwrote: Make sure you refer to the following assemblies. Microsoft.Scripting.dllMicrosoft.Scripting.Core.dll IronPython.dll IronPython.Modules.dll On Tue, May 26, 2009 at 11:47 PM, Justin Regele jregel...@gmail.comwrote: Trying to embed IPy in C#, and after digging all over the web and the archives of this list, I can't figure out why the Python object won't load. Here is the basic line where it goes wrong: ScriptEngine eng = Python.CreateEngine(); All the other typical Objects are loading fine, just not the Python object. I've tried a handful of different assemblies, and still nothing works. The embedding example from Iron Python in Action DOES work though, and I added assembly reflection code and can see that those assemblies were locale to that solutions folder. EZ quick fix, I thought was to copy those older assemblies over into the Iron Python assemblies (after backing them up). But still no luck. Pretty new to .NET and Visual Studio, but been dealing with CPython for years. Anyone have any ideas on what I could be doing wrong? Running Vis Studio 2008, Iron Python Studio Integrated, .NET 3.5 ___ Users mailing list Users@lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com -- nomadlife.org ___ 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