[Tutor] embarrassingly basic Tkinter question...

Alan Gauld alan.gauld at blueyonder.co.uk
Mon Jun 28 13:43:14 EDT 2004


> I've been through all of the documentation I can get my hands on,
and I
> have yet to find a clear answer-- can anyone tell me a good way to
> launch an application (under Linux) by clicking on a button created
with
> Tkinter?

You need to set the command parameter of the Button widget to a Python
function and make the Python function call an external program via
os.system()

> Basically, I want to create a simple menu application for my wife
(who's
> been lost on this machine since I switched to Xfce4)

Why not just give her a login using her preferred windowmanager? Thats
what multi user operating systems are for - each user gets the
environment they prefer!

> but I like to keep it relatively clean. Besides, there's a problem
that
> needs solving, and I'd love to be able to do it myself, the way I
want.

The command parameter is your friend.

Check my GUI topic on my tutorial which shows very simple use
of Buttons and the command parameter.

Alan G
Author of the Learn to Program web tutor
http://www.freenetpages.co.uk/hp/alan.gauld




More information about the Tutor mailing list