[Tutor] Windows Programs
Daniel Yoo
dyoo@hkn.eecs.berkeley.edu
Sat, 24 Mar 2001 15:11:26 -0800 (PST)
On Sat, 24 Mar 2001, Steve Collins wrote:
> I'm trying to find out how to create windows programs with python
> (also perl & c). Every language I learn I always finish at dos
> programs and can never find out how to create programs for windows.
> (I've come across win 95 assembly language, does this have to be used
> some how?) any help would be fantastic!
By a Windows program, do you mean one with menubars, buttons, and labels?
If so, then you'll want to look into Tkinter. (I know that Perl has
something similar called Perl::Tk, but for C... hmm... I guess you could
work with straight Tk.)
Tkinter is a module that helps us make graphical, windowed programs.
You'll be happy to learn that the programs you write with Tkinter will be
portable across platforms: ideally, they should work on Windows, macs, and
any other computer that supports Tkinter. For example:
###
from Tkinter import *
Label(text="Hello World").pack(side=LEFT)
mainloop()
###
is one of the simplest graphical programs that you can write with Tkinter.
It prints out the glorious message, 'Hello World', in a nice window, and
it runs anywhere, which is pretty cool. I wouldn't touch Win95 assembly
with a long pole, thank you. *grin*
There's quite a few of us trying to learn Tkinter here (I'm also a
newbie), so feel free to ask about Tkinter. There are a few resources
here:
http://python.org/topics/tkinter/
Good luck to you!