i'm trying to make some sample GUI tkinter thats on one button try server status,and if it works,after click on button start it destroy gui and start some function that sends me file text. I've made gui,and server connection test button, but don't know how to destroy gui and start function.Thanks a lot :)
from tkinter import *
import requests, os
class form():
root = Tk()
wel = Label(root,text="Welcome")
serv = Entry(root,width=40)
def checkConn():
if(requests.get(serv.get()).status_code==200):
print("Succesfull")
def start(self):
root.destroy()
prov = Button(root,text="Proveri",width=35, command = checkConn)
zap = Button(root, text ="Zapocni",width=35,command =start)
wel.pack()
serv.pack()
prov.pack()
zap.pack()
root.mainloop()
form()