[Pythonmac-SIG] How to create a desktop alias to run a python file?

Jack Jansen Jack.Jansen at cwi.nl
Fri Mar 23 11:12:30 CET 2007


On 20-mrt-2007, at 17:30, Alfred Morgan wrote:

> From: Stani's Python Editor <spe.stani.be at gmail.com >
> This is probably very easy, but I don't find how to do it. I want to
> execute this command if an user clicks on the icon of the alias on the
> desktop:
>
> /usr/bin/pythonw path/gui.pyw
>
> Like other people said, you probably don't want to do that, but  
> unlike other people, I'll answer your question.
>
> mkdir ~/Desktop/MyProg.app
> echo '#!/usr/bin/env pythonw /path/gui.pyw' > ~/Desktop/MyProg.app/ 
> MyProg
> chmod +x ~/Desktop/MyProg.app/MyProg
>
> double click MyProg on the desktop and it should launch your python  
> program using pythonw

I was very surprised when I saw this, I'd never seen this before.

And, indeed, when I tried it it didn't work:-(
Maybe you skipped an important step in the instructions?

--
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  
Goldman




More information about the Pythonmac-SIG mailing list