[Pythonmac-SIG] What does it take to run a GUI app?
Chris Barker
chris.barker at noaa.gov
Fri Aug 22 22:48:15 CEST 2014
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
Chris.Barker at noaa.gov
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/pythonmac-sig/attachments/20140822/2c7d06fa/attachment.html>
More information about the Pythonmac-SIG
mailing list