[wxPython-mac] Re: [Pythonmac-SIG] Wanted: working example of CFBundleTypeRole Shell

Kevin Ollivier kevino@tulane.edu
Fri, 8 Mar 2002 12:37:03 -0500


> > > I'm going to think about the problem a bit more: it's solved for the
> > > command line case already, and for the finder case (doubleclicking a
> > > .py file) I'm not so sure anymore that what you want if you double
> > > click a .py file is running it, a case could be made that you really
> > > want to open it in the IDE.
> >
> > Couldn't it be set up so that in the Finder case, when you double-click
> > on a .py file, the Python.app bundle would actually pass the script and
> > its arguments to the command line interface, then shut down?
>
> What about setting up a new file extension for this behaviour?  For
example
> a .pya for python application, or reuse the .pyw from MSW?

I think we should include support for other extensions that are being used,
like .pyw, but I think it's important to maintain compatibility as much as
possible with other Python distributions for a consistent experience. When
you double-click on a .py file in Windows, it runs the script, so I think we
should replicate this on Mac if possible. I've been checking, and it looks
like there are API calls for executing from the command line (exec() and
system()), so this should give us the behavior we are looking for without
much extra work. (multiple instances, GUIs work) However, if people want to
open the editor as the default action, we could create a dialog letting them
change this behavior.

Hopefully I will have some time this weekend to play with implementing this
functionality. =)

Kevin