This code is IronPython!
Won't work with CPython.

IronPython - Hello World

import clr
clr.AddReference('System.Windows.Forms')

from System.Windows.Forms import Application, Form, Label

form = Form(Text="Hello World Form")
label = Label(Text="Hello World!")

form.Controls.Add(label)

Application.Run(form)

Editor's note:
This post moved from Python GUI Programming sticky thread.
Please follow the rules of this thread and don't clutter it with questions!
Start your own thread and title it "IronPython Question" or something.

Recommended Answers

All 2 Replies

IronPython uses the Windows .NET CLR (Common Language Runtime) & libraries and most of the common Python syntax. The standard CPython is written to be cross platform, and that does not include the CLR.

For IronPython see:
http://www.ironpython.org/

IronPython uses the Windows .NET CLR (Common Language Runtime) & libraries and most of the common Python syntax. The standard CPython is written to be cross platform, and that does not include the CLR.

For IronPython see:
http://www.ironpython.org/

It wasn't a question. It was some code that displays a hello world Gui. I thought that I had put it in the right place.

Also, IronPython is relatively cross-platform and cross-browser. There's mono for linux, and the Silverlight plugin.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.