What does it take to run a GUI app?

Chris Barker <[email protected]>
Newsgroups gmane.comp.python.apple
Message-ID <CALGmxEJCzECMaP_enQHOm-9Rma9ubX-Z6UytRUum3arbdgWzeQ@mail.gmail.com>
Folks,

Over on the list for the Anaconda distribution, we've run into a limitation
in our understanding of the whole app bundle, etc business.

The problem is thus:

Anaconda is currently built with the old python / pythonw dichotomy.

python is a standard unix-style executable -- great for command line apps,
web servers, what have you. But you get the dreaded:

"""
This program needs access to the screen.
Please run with a Framework build of python, and only when you are
logged in on the main display of your Mac.
"""

when you try to run a GUI app (this error message from wxPython)

pythonw, on the other hand, is a shell script that re-directs to a python
that is inside a hand-built application bundle:

#!/bin/bash
export
PYTHONEXECUTABLE=/Users/chris.barker/PythonStuff/Anaconda/anaconda/bin/python
/Users/chris.barker/PythonStuff/Anaconda/anaconda/python.app/Contents/MacOS/python
$@

This all sort-of works. But it's a pain, because you may not know when you
start up an app, whether it needs to access the Window manger (like
iPython, for instance). And now I need to put "pythonw" in my #! lines,
which may fail on other *nix systems, and...

One thought is to simply have "python" be the same shell script as
"pythonw" but there is concern that having it be a re-directing shell
script may cause problems for some use cases.

I know that this has been solved for years in the python.org installer. So
how is that done?

Anaconda doesn't seem to want to make their python a proper framework build
-- don't know why not -- would there be any downside? But is it possible to
build the python executable so it can access the GUI system without
structuring their whole python install?

Thanks,
  -Chris


-- 

Christopher Barker, Ph.D.
Oceanographer

Emergency Response Division
NOAA/NOS/OR&R            (206) 526-6959   voice
7600 Sand Point Way NE   (206) 526-6329   fax
Seattle, WA  98115       (206) 526-6317   main reception

[email protected]

_______________________________________________
Pythonmac-SIG maillist  -  [email protected]
https://mail.python.org/mailman/listinfo/pythonmac-sig
unsubscribe: https://mail.python.org/mailman/options/Pythonmac-SIG
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.