i am trying to create a program which detects when someone click a button, so wht i want to do is when the user click the button then the "if" code should be ran, this will duplicate a file. Here is the code i used:
button1=Button(text="duplicate file", fg="green",bg="black")
button1.pack()
if button1 clicked:
f=open("prototype.txt","rb")
g=open(f,"wb")
so it might be my code makes no sense after all idk which code to use so does anyone know which code should i use?(the "clicked" keyword is invalid syntax, python says it is. If u know wht to use then pls tell)