Skip to content

Instantly share code, notes, and snippets.

@jleedev
Created August 1, 2010 20:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jleedev/503720 to your computer and use it in GitHub Desktop.
Save jleedev/503720 to your computer and use it in GitHub Desktop.
Hello world in IronPython with WinForms
#!/usr/bin/env ipy
import clr
clr.AddReference('System.Windows.Forms')
from System.Windows.Forms import Form, Button, Application
class HelloForm(Form):
def __init__(self):
super(HelloForm, self).__init__()
self.button = Button()
self.button.Click += self.on_button_clicked
self.button.Text = 'Click'
self.Controls.Add(self.button)
def on_button_clicked(self, sender, event):
sender.Text = 'Success!'
if __name__ == '__main__':
Application.Run(HelloForm())
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment