How do you execute an OS X application (bundle) from Python?

Just just at xs4all.nl
Fri Nov 5 09:05:17 EST 2004


In article 
<m2u0s4sb6e.fsf at unique.fully.qualified.domain.name.yeah.right>,
 Dan Sommers <me at privacy.net> wrote:

> > Developers of Mac apps, mostly -- and therefore developers of
> > infrastructure that runs on Macs to help apps -- apparently haven't
> > yet caught on to this reasonably-new bunch of users, me included, who
> > see MacOSX as just what it IS today -- a BSD with a neat GUI on top
> > (and a Mach underneath, sure, but that's hardly ever relevant;-).
> > Fine, I guess we'll stick with fink and darwinports and the like.  But
> > (unless I'm being paid for it) I'm not going to write an application
> > that I would never want to use myself.  So, if the only way to shell
> > out to an editor is to write commandline apps instead of GUIs, and use
> > /usr/bin/vi (which IS, after all, one editor Apple that is bundling,
> > to which we can easily shell out), then that's going to be what we do
> > -- until and unless shelling out to TextEdit or BBEdit or whatever is
> > just as easy.
> 
> There's a command line BBEdit wrapper somewhere; Bare Bones would seem a
> likely candidate to provide the second half of shelling out to them
> (i.e., letting the parent app know when the user closes the file's
> window in BBEdit).

BBEdit does indeed come with a command line tool (you need to install it 
separately). From the bbedit man page:

       -w     Wait until the file is closed in BBEdit. Normally,
              the bbedit tool exits immediately after the file
              arguments are opened in BBEdit. The -w option
              allows the bbedit tool to be used as an external
              editor for Unix tools that use the EDITOR global
              environment variable. To make this work using tcsh,
              add the following line to your .cshrc file:

              setenv EDITOR "bbedit -w"

Just



More information about the Python-list mailing list