[Tutor] TKinter and things over Linux

Bill Campbell bill at celestial.net
Sun Apr 17 00:50:56 CEST 2005


On Sat, Apr 16, 2005, joe_schmoe wrote:
>Alberto Troiano wrote:
>>Hi everyone
>> 
>>Sorry to bother you again but I don't know where else to go
>> 
>>I recently switch to Linux Red Hat AS 3.0 because I have to make a 
>>daemon to run in this OS and I'm having a few problems
>> 
>>I've struggle to replace Python 2.2(machine default) to 2.3.4 (tough but 
>>could)
>> 
>>Now I want to program a GUI with Tkinter but when I put the sentence 
>>from TKinter import *, it tells me that it doesn't find the module 
>>Tkinter. I have downloaded Python 2.3.4 from python.org and follow the 
>>steps.

The build process for python will pick up installed libraries for various
components (e.g. Berkeley database, Tk, etc.), so if you don't have Tkinter
on your system, and you built python yourself, it probably means that you
don't have the necessary Tk/TCL development libraries installed on the
system.  Careful perusal of the output of the build is necessary to see
what libraries have been built, and which were skipped.  I normally build
using ``make 2>&1 | tee makelist'' which puts all the output in the file
makelist which I can then examine when the make is complete.

>>Secondly I want to know how to run the .py programs and which is the 
>>extension of a GUI in Linux (I know that for Windows is .pyw but it 
>>doesn't know what are these in Linux)

Python scripts should Just Run(tm) whether they have a .py extension or not
on a Linux box.  Linux, and most *nix flavours don't depend on the file
suffix to determine what type of file it is, but generally look at the
first few bytes of the file (if a text file starts with ``#!'' the rest of
the line is taken to be the command to run the script.

...

Bill
--
INTERNET:   bill at Celestial.COM  Bill Campbell; Celestial Software LLC
UUCP:               camco!bill  PO Box 820; 6641 E. Mercer Way
FAX:            (206) 232-9186  Mercer Island, WA 98040-0820; (206) 236-1676
URL: http://www.celestial.com/

When you have an efficient government, you have a dictatorship.
                -- Harry Truman


More information about the Tutor mailing list