PDA

View Full Version : Python UI question




lynkynpark86
Dec 21, 2011, 09:03 AM
Is there a way to show a dialog box in Python without Tk, wx-python, etc? Is there something similar to AppleScript's "display dialog" I could use?



chown33
Dec 21, 2011, 11:53 AM
Run the 'osascript' command from Python.

Example shell command line:
osascript -e 'tell app "System Events" to display dialog "Explode the penguin now?"'

I assume you know how to open the man page for osascript, how to run subprocesses in Python, etc.

lynkynpark86
Dec 21, 2011, 05:09 PM
Run the 'osascript' command from Python.

Example shell command line:
osascript -e 'tell app "System Events" to display dialog "Explode the penguin now?"'

I assume you know how to open the man page for osascript, how to run subprocesses in Python, etc.

Thanks, I just tried:

osascript -e 'display dialog "Hello world"'

It works now with system events, thanks!