Hi,
Noticed on the Mac that after a script runs the terminal is still there and not usable, one has to control q it to go away. Is there a way to have the script quit the terminal from the script when it ends?
Thanks,
jkrueger
Hi,
Noticed on the Mac that after a script runs the terminal is still there and not usable, one has to control q it to go away. Is there a way to have the script quit the terminal from the script when it ends?
Thanks,
jkrueger
Huh. Why on Earth would you want that? Note that if you have multiple terminal windows open, pressing ⌘-Q causes them all to close. ⌘-W is a better choice.
OK, control w, can the command come from the python script?
This is in reference to a script that has a request from the user, it they wish to continue. If they say no the script ends. On Linux and the PC all is fine. On the mac the terminal is left and not usable as a terminal and requires a control w to get rid of it. I'd like to there a way to have the script quit the terminal.I've searched here and google, etc. and found nothing. Maybe I'm asking wrong. Thanks for any assist, jkrueger
Huh. Why on Earth would you want that? Note that if you have multiple terminal windows open, pressing ⌘-Q causes them all to close. ⌘-W is a better choice.
OK, ⌘-W, is there a way to have that at the end of the script?
raise SystemExit('Bye, bye')
does not work?
raise SystemExit('Bye, bye')
does not work?
No, tried it on a Mac.
Tried to set script to run with pythonw?:
4.1.2. Running scripts with a GUI
With older versions of Python, there is one Mac OS X quirk that you need to be aware of: programs that talk to the Aqua window manager (in other words, anything that has a GUI) need to be run in a special way. Use pythonw instead of python to start such scripts.
With Python 2.5, you can use either python or pythonw.
Tried to set script to run with pythonw?:
4.1.2. Running scripts with a GUIWith older versions of Python, there is one Mac OS X quirk that you need to be aware of: programs that talk to the Aqua window manager (in other words, anything that has a GUI) need to be run in a special way. Use pythonw instead of python to start such scripts.
With Python 2.5, you can use either python or pythonw.
Thank you, that works. If I distill the script with cxfreeze or py2ap how do I tell either to be using pythonw? or isn't it necessary?
Again thanks.
Thank you, that works. If I distill the script with cxfreeze or py2ap how do I tell either to be using pythonw? or isn't it necessary?
Again thanks.
OK, being a Linux user for 15 years with some Mac in the beginning. I have gcc loaded using Xcode from Apple, cx_freeze needed it to install. It installed fine. Did a distillation with it. Running the distilled script has the terminal stays open saying it is complete and yet not usable as a term anymore. This is the same as running the py from python on the Mac. These are real simple scripts, they work fine on the PC and Linux distilled and as py.
If I just run a script on the Mac using pythonw it leaves the terminal still operable. Anybody know of a way to close the terminal from the script when it ends? Or tell cxfreeze to use pythonw?
Please,
jkrueger
OK, since the script has a "Redo? y/n" I just put in a text instruction which appears at the Mac logout "Enter Cmd-W to close window!". It will do, and of course the Linux and PC cxfreeze version just close the window at the end of the scripts run.
The Mac is so silly, end of story,
jkrueger
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.