Quick scripting for .NET with IronPython
While Ruby and Groovy seem to get all of the attention, there's one scripting language that has been around for a lot longer and that has quietly been picking up in popularity over the long run. That language is Python, and, according to the TIOBE Programming Community Index Python was the language of the year for 2007.
While …
This topic is closed for new posts.
Posted Thursday 13th March 2008 15:33 GMT
Anonymous Coward
Leave off the "if __name__" stuff
#

I'd suggest leaving off the
if __name__ == '__main__':
line. That's useful when you have a python file that might be used as either a script or imported into another module. It's pretty clear from the way the rest of the code is structured that this code could only be used as a script.
Posted Thursday 13th March 2008 16:50 GMT
Anonymous Coward
Oh, come on...
#

It's nice to see IronPython get coverage, and the example of accessing the CLR is welcome, but...
Using a global variable ('excel')? Printing from within a function? Surely you can structure your code better than that...
Posted Thursday 13th March 2008 19:53 GMT
amanfromarse
Ruby
#
Ugh, horrible code. No thanks.
Ruby's been around longer than Python, btw.
Ruby!=Rails
Posted Friday 14th March 2008 01:40 GMT
Simon Ward
Re: Ruby
#

"Ruby's been around longer than Python, btw."
Not from where I'm sitting - first appearance of Python:1991, first appearance of Ruby: 1995 (I don't have a particular beef with Ruby, other than that it appears to offer no advantage over Python and/or Perl)
Oh yeah, agree with the first AC with regard to the use of global variables. Very sloppy.
Posted Friday 14th March 2008 08:53 GMT
Joe Diablo
Re: Ruby
#
Ruby only seems like it's been around longer, since it's so damn slow.
Posted Friday 14th March 2008 10:27 GMT
Anonymous Coward
@Anonymous Coward II
#

yeah, but it looks like the intention is to show how this stuff works, not to produce production code
about time we had some Python coverage...
This topic is closed for new posts.