[Pythonmac-SIG] Shortcut for IDLE on Mac OS X (LEOPARD)

Gregor Lingl gregor.lingl at aon.at
Thu Oct 8 00:05:03 CEST 2009



Ronald Oussoren schrieb:
>
> On 7 Oct, 2009, at 22:18, Gregor Lingl wrote:
>
>> Hi,
>>
>> I'm relatively new to the Mac.
>> I have a Python 3.1.1. installation on my Macbook
>> and I'd like to have a shortcut on my desktop starting
>> IDLE with the -n switch, that is without subprocess
>
> Why do you want to do that?  Is there functionality in IDLE that works 
> with the '-n' switch but not without it?
Yes, I want to do interactive turtle graphics. (In fact I've written a book,
"Python für Kids" and I was asked by a reader how to do it on a Mac.)
>
>>
>> Under Windows I'd rightclick on the desktop, create a
>> new shortcut and then enter as the target:
>>
>> C:\Python31\pythonw C:\Python31\Lib\idlelib\idle.pyw -n
>> Then I have to give it a name and it's ready. (Additionally
>> I have the option to change the icon)
>>
>> Is there a similar and similarly simple way to do this
>> with Mac OS X? (Leopard)
>>
>> I am able to start IDLE in this mode from a terminal,
>> but thats rather cumbersome
>>
>> python3 
>> /Library/Frameworks/Python.framework/Versions/3.1/lib/python3.1/idlelib/idle.py 
>> -n
>
The solution you gave works fine for me. It retains those features of IDLE
I use. (At least as far as I could see on a quick inspection)
> You can store this command in a file and then give the file execute 
> permissions, e.g.:
>
>  $ cat > run-IDLE <<-EOF
>  #!/bin/sh
>  /Library/Frameworks/Python.frameworks/Versions/3.1/bin/python3 \
>     
> /Library/Frameworks/Python.framework/Versions/3.1/lib/python3.1/idlelib/idle.py 
> -n
>  EOF
>  $ chmod 755 run-IDLE
Of course I, and especially the Kids, would prefer to click an icon on 
the desktop, or the
dock. But as a first solution I appreciate this one very much.

Thanks for the quick help!
Gregor

> Double-clicking should then start IDLE.
>
> The result is not quite equivalent to IDLE.app in the "Python 3.1" 
> folder, that is a real application bundle and contains some special 
> code to ensures that IDLE behaves more like a Mac applications (in 
> particular the key bindings).
>
> Ronald
>


More information about the Pythonmac-SIG mailing list