-
-
Save allfro/2202591 to your computer and use it in GitHub Desktop.
Tkinter activation workaround
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
## This script demonstrates a workaround for the Tkinter (Tcl/Tk?) activation | |
## bug under OS X. More on that here: | |
from easygui import msgbox | |
from subprocess import Popen | |
from Tkinter import Tk | |
## Bring easygui to foreground | |
# First we need to create a window to activate the Python.app | |
Tk().destroy() | |
# Next we activate it | |
Popen(['osascript', '-e', 'tell application "Python" to activate']) | |
## Start using Tkinter/EasyGUI/Grun with the interface in the Foreground | |
msgbox('Hello world!') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Works for me on OSX 10.7.3 Lion. Thank you!