xxxxxxxxxx
from tkinter import *
window = Tk()
def command
pass #this pass stands for the command of your button
button.destroy() #write this at the end of your command(button is your button name)
button = Button(window,text='hello',command=command) #your button
but.pack()
window.mainloop()