IronPython 1.0 release
CLIに準拠した環境で動作するIronPythonがリリースされました.
IronPython - Home
もちろん.NET Framework上でも動作するため,C#でよく使うライブラリもそのまま使用することが可能です.試しに使ってみると...
import clr
clr.AddReference("System")
clr.AddReference("System.Drawing")
clr.AddReference("System.Windows.Forms")
from System import *
from System.Drawing import *
from System.Windows.Forms import *
class Form1(Form):
def __init__(self):
self.label = Label()
self.label.Text = "Hello World.\nKrdLab's Diary."
self.label.AutoSize = True
self.label.Font = Font("Verdana", 18)
self.btn = Button()
self.btn.Text = "Exit"
self.btn.AutoSize = True
self.btn.Dock = DockStyle.Bottom
self.btn.Click += self.btn_Click
self.Text = "Iron Python on the .NET Framework"
self.Controls.Add(self.label)
self.Controls.Add(self.btn)
def btn_Click(self, sender, e):
self.Close()
Application.Run(Form1())
