I was making a simple script for switching between different directories. However, whenever I run the script, all of the commands attatched to the buttons automatically execute.
import os
from tkinter import *
from tkinter import ttk
root = Tk()
win = ttk.Frame(root, padding=10)
win.grid()
cleandir = r"cleandir.lnk"
moddir = r"moddir.lnk"
ttk.Label(win, text="What profile would you like to run?").grid(column=0, row=0)
ttk.Button(win, text="Modded", command=os.startfile(moddir)).grid(column=0, row=1)
ttk.Button(win, text="Clean", command=os.startfile(cleandir)).grid(column=1, row=1)
root.mainloop()
I don't get any errors and the menu shows up and works fine, however, both files attatched to my buttons run anyways.