Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save pressure679/9f08baf5a0a3c98bcc12aebfa5ce0f43 to your computer and use it in GitHub Desktop.
Save pressure679/9f08baf5a0a3c98bcc12aebfa5ce0f43 to your computer and use it in GitHub Desktop.
# From https://stackoverflow.com/questions/25028717/run-a-shell-script-from-python-gui
# assuming Python3
import tkinter as tk
import subprocess as sub
WINDOW_SIZE = "600x400"
root = tk.Tk()
root.geometry(WINDOW_SIZE)
tk.Button(root, text="Push me!", command=lambda: sub.call('path/to/script')).pack()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment