[Pythonmac-SIG] How to create a desktop alias to run a python file?
Jack.Jansen at cwi.nl
Sat Mar 24 00:24:08 CET 2007
On 23-Mar-2007, at 22:27 , Alfred Morgan wrote:
> cat > /tmp/alfred_hw.py << .
> from Tkinter import Tk, Label
> Label(r, text="Hello World").pack()
> mkdir ~/Desktop/alfred_hw.app
> cat > ~/Desktop/alfred_hw.app/alfred_hw << .
> #!/usr/bin/env pythonw /tmp/alfred_hw.py
> chmod +x ~/Desktop/alfred_hw.app/alfred_hw
Yes, this one works for me just fine!!
I'm very surprised, because it does not follow any Apple guideline
for application bundles that I've ever seen. (Also, I don't know what
I did differently yesterday when it didn't work for me, but never
mind that). BTW: you can make things even simpler by putting the
Python code into alfred_hw. And moreover you don't need pythonw,
apparently because you're in an App bundle already:
cat > ~/Desktop/alfred_hw.app/alfred_hw << .
from Tkinter import Tk, Label
Label(r, text="Hello World").pack()
chmod +x ~/Desktop/alfred_hw.app/alfred_hw
Is anyone else familiar with such simple .app bundles?
Jack Jansen, <Jack.Jansen at cwi.nl>, http://www.cwi.nl/~jack
If I can't dance I don't want to be part of your revolution -- Emma
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Pythonmac-SIG