How do I make Windows Application with Python ?

Doug Holton a at b.c
Wed Jan 5 12:22:24 EST 2005


BOOGIEMAN wrote:
> Thanks all for very detailed answers. BTW I tried this one but it seems
> that it doesn't use VS'es visual designer. Also it doesn't have "build"
> option so it is basicly only usefull to higlight Python syntax.
> Active Sate Komodo looks like much better choice

I don't know of any python IDE with a visual designer and a build to exe 
option.

But since you are familiar with Visual Studio and you are developing on 
Windows, you might check out the free SharpDevelop IDE: 
http://www.icsharpcode.net/OpenSource/SD/

Then unzip this boo add-in into the SharpDevelop folder under Program 
Files: http://coedit.net/boo/BooBinding.zip

Then you can start up SharpDevelop, create a new boo project, press the 
green play button, and your exe will be built and executed (the one 
below is only 4kb in size).  We are working on adding support for 
SharpDevelop's visual form designer soon.

To show a Windows message box instead of printing to the console like 
you were asking earlier, you can use code like this:

import System.Windows.Forms
MessageBox.Show("your message")

Or for a more complete windows app:

import System.Drawing
import System.Windows.Forms

class MainForm(Form):
	def constructor():
		self.Text = "My Window"
		
		b = Button(Text: "Click Me")
		b.Location = Point(100,75)
		b.Click += def():
			MessageBox.Show("Button clicked")
		#or:
		#b.Click += OnButtonClick

		self.Controls.Add(b)

	def OnButtonClick():
		MessageBox.Show("Button clicked")


f = MainForm()
Application.Run(f)



More information about the Python-list mailing list