Created
November 29, 2013 04:22
-
-
Save puyo/7701547 to your computer and use it in GitHub Desktop.
A little bit of code to focus the window when running Python Tkinter programs from the command line on OSX.
This file contains hidden or 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
import sys, os, threading | |
if sys.platform == 'darwin': | |
def raise_window(): | |
os.system("""osascript -e 'tell app "Finder" to set frontmost of process "Python" to true'""") | |
threading.Timer(0.1, raise_window).start() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment