[Pythonmac-SIG] [MachOPython] starting an application from a Python script?

Pieter Claerhout Pieter.Claerhout@Creo.com
Wed, 24 Apr 2002 09:33:49 +0200


You basically will have to use the findertools.launch function. It
takes one argument, which is the path of the application. If you know
the creator code of the application, you can do the following thing:

    f = macfs.FindApplication('8BIM')
    fPhotoshop = findertools.launch(f)

This example will launch Photoshop after it found the path based on
the creator code of Photoshop, which is 8BIM.

Hope this answers your question.

Cheers,


Pieter

-----Original Message-----
From: Kevin Ollivier [mailto:kevino@tulane.edu]
Sent: Tuesday, April 23, 2002 23:29
To: pythonmac-sig@python.org
Subject: [Pythonmac-SIG] [MachOPython] starting an application from a
Python script?


Hi all,

I'm using the 2.3 version of MachOPython downloaded from CVS. I have a
wxPython script which allows users to specify a "preferred" web browser and
HTML editor and then uses those preferred editors to preview/edit HTML
files. In Windows and Linux/UNIX, I call os.spawnv and pass in the program
location and filename to open. On Mac, however, this seems not to be
implemented. (There is no error message, but the call is not executed.
Online Mac library documentation does not list it as a supported method.)
What would be the equivalent way of doing this in MachOPython? I can use the
webbrowser module as a workaround for the browser, but that still leaves the
editor. Would I use something like AppleEvents for this?

Thanks for your help!

Kevin



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