[Tutor] Tkinter + OSX

montana sarmxiii@knology.net
Thu, 19 Sep 2002 17:00:37 -0500


On Thursday, September 19, 2002, at 12:51 AM, darksyyyde wrote:

>
> On Wednesday, September 18, 2002, at 07:41 PM, 
> tutor-request@python.org wrote:
>>
>>
>> First try this at the command line:
>> %which python
>>
>> If your reply is /sw/bin/python or something dimilar from the /sw
>> directory then fink screwed up.
>>
> No, i made a /usr/local/bin before config and make
>
> %wich python  -- reflects it correctly.
>
No that is not exactly what I'm talking about. If you built it from 
source, python would be installed in the correct directories and this 
will not matter. Did you build it from source, or did you install using 
the Mac installer. Big difference. As someone else has already pointed 
out, you have to build Python from source with Tk this is what the fink 
install does. Huge difference. What you have here is probably no 
different than the OSX default Python in 10.2, this is why I have this 
problem also. Of course I have not yet put fink on this install.
>
>> If the reply is /usr/bin/python then you do not have you environment
>> setup properly because it is not recognizing apps from /sw/bin.  Once
>> /sw/bin is in your path you should remove any trace of python from
>> usr/bin and usr/lib then you can setup the default python to be from
>> /sw/bin instead of /usr/bin. This is the issue you will encounter when
>> using fink. All your apps are installed under /sw/bin. I wish the fink
>> developers would come up with a way to add this to your PATH
>> automatically. But alas ...
>>
>
> The thing is, the fink/gzip wouldnt work.
> so i pulled the tar.gz via gui out of fink and into my /usr/local/bin.
> Then just unzipped it with stufit expander.
> Then opened terminal and set up the directory. Then ./configure.
> Then %sudo make install.
> Ill see what the mac pythoneers have to say about it.
> I appreciate the responses here though.
>
>> Anyways. 10.2 has python installed natively and I heard it has Tk and
>> Tcl installed by default also but I get the same error. What this 
>> error
>> is saying is that Tk is not installed properly because python cant 
>> find
>> it?
>>
>> There are some sites out there that explain how to install TK/Tcl and
>> there is a MacOSX release for this, but I never got it to work right
>> under 10.1 so I had to resort to the fink method also. It works if you
>> are running under XDarwin so it really is not native. Hopefully the
>> mac-python group will get it together and switch to OSX so that some
>> progress can be made in this direction. They are still the python with
>> Tkinter support for OS9. Oh well, one can wish...
>>
> fink installed tcl/tk just fine. However its not in the same directory
> as python.
>
Try same:
% wish tclsh and see what response you get. You should have something 
like /sw/bin/tclsh if fink installed ok. Fink installs Tcl and Tk 
libraries in /sw/lib so there is no way to build python from scratch 
with Tk support unlees this directory is in your lib PATH. (I have no 
idea how to do this so you will need to ask someone else) Fink gets 
around this by it's own special installer that looks for Tcl/Tk 
Libraries as far as I know. As a matter of fact, you have to get the 
fink version of python that is built for Tk. This is different than you 
run of the mill python or the other python installs off of fink. Try:
%fink list

And scroll down till you get to all of the different python installs.

>> You could always use jython and use the built in java on OSX.
>
> That would be kind of cool. I know very little about it though.
> Is it a half breed between java and python, or just python that can 
> import/
> use java classes etc. ?
>
Somewhat from what I can gather. Seems to import java classes or you 
can write java programs with pyhton code embedded from what I can 
gather.
>>
>> Other than that it is still a PC world for Pythoneers. Unless you feel
>> like hacking it together.
>>
>
> Why couldnt python use/import the project builder files used for 
> templates
> of cocoa(objective C) applications?
> Then mac people wouldnt even have to worry about tkinter.
>
Apple already has cocoa set up to run with Java code as well as C, I 
wonder how hard it would be for them to set it up to run with python, 
perl, or ruby scripts also?
>
>
I think there is someone named Tony Lownds (or something like that) 
that has a site describing how to get Aqua Tk working. I have had 
limited success with this but you may do better. If you get it to work 
Ok (if you decide to go this route), let us all know how it is set up.

Hope some of this helps

SA


"I can do everything on my Mac I used to do on my PC, plus alot more 
..."
--Me