Here are some quick notes on how to interface with the framework from Iron Python:
- Open the Iron Python REPL.
- Import the
- Add a reference to the .NET Namespaces you want to interact with.
- Start using the .NET classes as if they were Python classes.
Below I transcribed a little code snippet for you to use as an example. I also provide a screen capture of the sample and the outcome of running it.
import clr clr.AddReference("System.Windows.Forms") from System.Windows.Forms import Application, Form, Button, MessageBox f = Form() b = Button() f.Text = "Hello World!" b.Text = "Click Me!" def clicked(sender, args): MessageBox.Show("Hello, Again...") b.Click += clicked f.Controls.Add(b) f.ShowDialog()