Programming in almost language

This is the site where you may share your knowledge and experience to eachother..

  • Categories

  • LinkedIn

  • Tweet Me

  • My footsteps

IronPython with Microsoft.Net

Posted by Praveen Kumar on February 11, 2008

Q: How do .NET assemblies and namespaces relate to Python modules?

In IronPython, the import mechanism provides access to the namespaces in .NET assemblies. Once the assembly is referenced by the IronPython runtime, it is possible to import the namespaces contained within the assembly. Once a namespace is imported, all nested namespaces are also accessible. For more information, see the exercise in the IronPython Tutorial (if you’re reading the FAQ on the web, the tutorial.htm document is in the tutorial directory where you installed IronPython).

>>> import System

>>> clr.AddReference(“System.Windows.Forms”)

>>> import System.Windows

>>> form = System.Windows.Forms.Form()

 
Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

 
%d bloggers like this: