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

2007-03-20 Thread Ronald Oussoren

On 19 Mar, 2007, at 17:35, Stani's Python Editor wrote:

> Hi,
> 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

That short answer is that you don't really want this :-). What you  
seem to want is to create a clickable application and there are  
several ways to do that. The best way is use py2app to build a full  
application bundle, another alternative is using the Applet Builder  
in MacPython (but Apple doesn't ship this tool, so you cannot use  
this with /usr/bin/pythonw).

Py2app can be found here: http://www.python.org/pypi/py2app. It  
includes a number of examples, including some wxPython ones.

Ronald

___
Pythonmac-SIG maillist  -  Pythonmac-SIG@python.org
http://mail.python.org/mailman/listinfo/pythonmac-sig


Re: [Pythonmac-SIG] (no subject)

2007-03-20 Thread Ronald Oussoren

On 20 Mar, 2007, at 3:04, Calder Coalson wrote:

> Dear Fellow Macppl,
>
> I've googled this problem, and other people have had it but no one
> has solved it.  I've been developing Python/Cocoa apps for a little
> while, (I'm still bad at it) using the terminal 'python setup.py
> py2app' build sequence, but I'm making a document based application
> now and would like to use the xcode template.  Unfortunately, the
> xcode build sequence doesn't work for me because I get the error:
> ImportError: No module named Py2app
>
> when I try to build the project.  Any suggestions?

The xcode template is using a different version of python. The  
easiest way to fix that is to replace the #! line at the top of  
setup.py by a line that mentions the absolute path of the python  
interpreter that you want to use.

Ronald

___
Pythonmac-SIG maillist  -  Pythonmac-SIG@python.org
http://mail.python.org/mailman/listinfo/pythonmac-sig


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

2007-03-20 Thread Alfred Morgan


From: Stani's Python Editor <[EMAIL PROTECTED]>
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

--
-alfred
___
Pythonmac-SIG maillist  -  Pythonmac-SIG@python.org
http://mail.python.org/mailman/listinfo/pythonmac-sig