How to destroy the First Window?

Multi tool use
Multi tool use


How to destroy the First Window?



I am making the GUI Chat Program using the following Steps as following:



After the Login is successful, the First Window has not been destroyed.
(OS : window 7, Python 2.7)



Please, help me to destroy the First Window successfully!!



chat_login.py:


from socket import *
import thread, time
import msvcrt as m
from tkinter import *
from tkinter import scrolledtext
import os
import sys

login_w = Tk()
login_w.title("The SCH Chat-Client V0.1")

login_w.geometry('400x100')

s = socket(AF_INET, SOCK_STREAM)
id_label = Label(login_w,text=" I D : " )
id_label.grid(column=0, row=0)

id_txt = Entry(login_w)
id_txt.grid(row=0, column=1)

pass_label = Label(login_w,text="Password : " )
pass_label.grid(column=0, row=1)

pass_txt = Entry(login_w)
pass_txt.grid(row=1, column=1)

def recvMsg(sock):
while True:
recvmsg = sock.recv(1024)

def Con_Clicked():
host = "127.0.0.1"
port = 8008
print host
try:

s.connect((host, 8008))
thread.start_new_thread(recvMsg, (s, ))
time.sleep(1)
nickmsg = id_txt.get()
s.send(nickmsg)
time.sleep(2)
print 'Wait!'
os.system('python chat_client_testG.py')

except:
print "Wrong address!"

con_btn = Button(login_w, text="Login" , command = Con_Clicked )
con_btn.grid(column=0, row=2)

login_w.mainloop()





print 'Wait!' os.system('python chat_client_testG.py') exit()
– 성지환
Jun 29 at 4:15










By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

lZSAoRvCBWwIqsnvYoABOhEeBqhnbzF s9OqomaEvL5MuDiFYYP5OV3IWZsV4waIRQ
91FpJxzK6aUe,jKyXWA63IdID5

Popular posts from this blog

Rothschild family

Cinema of Italy