Iron Python - A Walk thru

What is Iron Python?

 Iron Python is Microsoft's implementation of the Python Language using the .NET Technology. Its a powerful and easy to learn.

Basics of Iron Python:

This is the welcome screen when you load the IPY Console

 

 Iron Python interprets the codes line by line and hence it'll take couple of min between execution of each statements.

 

Lets see how IPY displays a text :

 

The Syntax is print text_here. For example, here i'm displaying Hello. The syntax for it is print "Hello". 

 Lets see how IPY does swapping of 2 number:

 

In IPY, there are no concepts of arrays etc. All you have is something called Lists. This List can contain anything ie: numbers, characters, strings, etc TOGETHER :) :)

Syntax for declaring a list is:

var_name=[int_val,"String_value",'Char_value']

In the above program, i've declared 2 variables and b with the following contents:

a=[1,"Rajesh",'R']

b=[2,"Microsoft",'C']

Now, the big job of swapping :(  .. 

We break our head in figuring how should we use the function for swapping - either by passing values or by passing address. Well, all I can say is IPY makes life easy :) :) 

All u need to do is :

a,b=b,a

and your swapping is done :) :)

now when you give print a and print b u'll find that swapping is complete :) :)

 

There are a lot of things that you can do using IPY. I'll shortly upload more examples in IPY.

You can visit This Link for downloading the IPY setup file. Keep checking the link for downloading the IPY extension for VS 2010 :) :)

Published Monday, May 24, 2010 1:22 AM by irajesh

Comments

# re: Iron Python - A Walk thru@ Wednesday, May 26, 2010 2:21 AM

The blog post is a good learning experience for onces who are new to Iron python. Written to the point and easy to understand.. Great work rajesh :)