I've been looking into Tkinter and recently have made a small program just to monitor folders and check how many files are inside.
I'de like to create buttons that open the folders in Windows Explorer but I can't find any info on doing so.
Anyone got any Ideas?
Cheers, Jon
Thanks for the quick response I'd already tried something similar but I'm probably doing something wrong. Here's my code :
def open():
os.system("explorer C:\\ folder dir")
label1 = Button(self, text="Pre TC", fg="red", font=("Ariel", 9, "bold"), command=open)
self has to be used when you are calling a function defined under the same class name of which label1 or button1 is an object. Otherwise you get the Tkinter callback exception as the function is not found.
That is why renaming open to self.open works
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With