[Pythonmac-SIG] Launch App in background
Bill Bedford
billpy@mousa.demon.co.uk
Sun, 6 Sep 1998 01:30:41 +0100
At 10:41 pm +0200 05/09/98, Vincenzo Tschinke wrote:
~I would like to use an helper application that processes some files for my
~python script. On the Mac I tried this hack:
~
~import findertools
~import sys
~
~def launch_app(app):
~ # invoke finder
~ findertools.launch(app)
~ # hack to refocuse on Python!
~ findertools.launch(sys.executable)
~
~This has the disadvantage that Python goes in the background and the
~desktop appears for a certain time (a few seconds in my case) with
~whatever messy bunch of windows and icons is at hand. Changing the "finder
~flags" of the application itself (background only, etc.) does not have an
~effect.
~
~Does anybody have a better method? Would at least be possible to show a
~box telling "Work in progress" or something while the application is
~running?
Your helper application should come to front, not the finder. The way to to
do what you want is use a second method which is called after the helper.
def launch_pyth():
# hack to refocuse on Python!
findertools.launch(PYTHON)
PYTHON is the path to the python application not sys.path
Bill Bedford
Owner Brit_Rail-L list for the history of railways in Britain
Subscribe at autoshare@mousa.demon.co.uk