simple gui

This commit is contained in:
cbh123 2024-03-27 19:57:15 -07:00
parent 1174275b5b
commit 8662a19a51
1 changed files with 31 additions and 0 deletions

31
gui.py Normal file
View File

@ -0,0 +1,31 @@
import tkinter as tk
import subprocess
NARRATOR_DIR = "/Users/charlieholtz/workspace/dev/narrator"
def run_command1():
applescript_command = f"""
tell application "Terminal"
do script "cd {NARRATOR_DIR} && source .env && source venv/bin/activate && python3 capture.py"
activate
end tell
tell application "Terminal"
do script "cd {NARRATOR_DIR} && source .env && source venv/bin/activate && python3 narrator.py"
activate
end tell
"""
subprocess.run(["osascript", "-e", applescript_command])
# Create the main window
window = tk.Tk()
window.title("AI Narrator")
# Create buttons for each command
button1 = tk.Button(window, text="Start", command=run_command1)
button1.pack(pady=10)
# Start the GUI event loop
window.mainloop()