[Pythonmac-SIG] Fwd: MacPython icon mockup

Bob Ippolito bob at redivi.com
Tue Apr 11 00:56:32 CEST 2006


On Apr 10, 2006, at 2:45 PM, has wrote:

> Ronald wrote:
>
>>>> I think you're totally mislead as to what IDLE does.  Yes, it  
>>>> has interactive interpreters with a save feature, but it also  
>>>> edits source files and has a debugger.  It IS conventional.
>>>
>>> Yep, you're right. I never use IDLE myself (it's a bizarre- 
>>> looking beast [1] and I notice it doesn't run appscript either)  
>>> so missed that bit. Go with the SE-like format then.
>>
>> It should do appscript in the universal build.
>
> Python 2.4.3/IDLE 1.1.3; appscript just raises a 'no window manager  
> connection' in the interpreter window. Dunno why.

 From an IDLE session:

 >>> import sys
 >>> sys.executable
'/Applications/MacPython 2.4/IDLE.app/Contents/MacOS/Python'
 >>> import MacOS
 >>> MacOS.WMAvailable()
False

If you add a little hack like this to its startup script (or to  
bundlebuilder even), then it will work:

import sys
sys.executable = sys.prefix + '/bin/python' + sys.version[:3]

 >>> import sys
 >>> sys.executable
'/Applications/MacPython 2.4/IDLE.app/Contents/MacOS/Python'
 >>> import MacOS
 >>> MacOS.WMAvailable()
True

I'm not sure why sys.executable is what it is in the subprocess, but  
WMAvailable does indeed work with that hack.

-bob



More information about the Pythonmac-SIG mailing list