Register FAQ / Rules Forum Spy Search Today's Posts Mark Forums Read
Go Back   MacRumors Forums > Apple Systems and Services > Programming > Mac Programming

Reply
 
Thread Tools Search this Thread Display Modes
Old Dec 21, 2011, 09:03 AM   #1
lynkynpark86
macrumors 6502
 
Join Date: Mar 2010
Location: Maine, USA, Earth, Solar System, Milky Way, Universe
Python UI question

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?
__________________
White MacBook, 2.13 GHz, 2 GB RAM, 160 GB HD
Dell w/ 4GB RAM, AMD Athlon
iPod Touch 4G (or 5G :P), 32GB, iOS 5.1, awaiting jailbreak.
lynkynpark86 is offline   0 Reply With Quote
Old Dec 21, 2011, 11:53 AM   #2
chown33
macrumors 601
 
Join Date: Aug 2009
Run the 'osascript' command from Python.

Example shell command line:
Code:
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.
chown33 is offline   0 Reply With Quote
Old Dec 21, 2011, 05:09 PM   #3
lynkynpark86
Thread Starter
macrumors 6502
 
Join Date: Mar 2010
Location: Maine, USA, Earth, Solar System, Milky Way, Universe
Quote:
Originally Posted by chown33 View Post
Run the 'osascript' command from Python.

Example shell command line:
Code:
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:
Code:
osascript -e 'display dialog "Hello world"'
It works now with system events, thanks!
__________________
White MacBook, 2.13 GHz, 2 GB RAM, 160 GB HD
Dell w/ 4GB RAM, AMD Athlon
iPod Touch 4G (or 5G :P), 32GB, iOS 5.1, awaiting jailbreak.
lynkynpark86 is offline   0 Reply With Quote

Reply
MacRumors Forums > Apple Systems and Services > Programming > Mac Programming

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
thread Thread Starter Forum Replies Last Post
learning python - question about GASP OffDog Mac Programming 11 Sep 21, 2011 04:14 PM
bash/python question lynkynpark86 Mac Programming 2 Jun 8, 2011 01:05 AM
Python terminal command? lynkynpark86 Mac Programming 2 May 28, 2011 04:28 PM
python newbie questions jamesapp Mac Programming 8 Jun 24, 2008 09:58 PM
One last python programming question iHerzeleid Mac Programming 6 Mar 15, 2008 12:44 AM


All times are GMT -5. The time now is 07:35 AM.

Mac Rumors | Mac | iPhone | iPhone Game Reviews | iPhone Apps

Mobile Version | Fixed | Fluid | Fluid HD
Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.

Privacy / DMCA contact / Affiliate and FTC Disclosure
Copyright 2002-2013, MacRumors.com, LLC