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

Alfred Morgan alfred at 54.org
Tue Mar 20 17:30:55 CET 2007

> 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

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.python.org/pipermail/pythonmac-sig/attachments/20070320/1436b7c6/attachment.htm 

More information about the Pythonmac-SIG mailing list