CLIENT
1. The initialization for the client.
import threading
from socket import*
from Tkinter import*
root=Tk()
class ChatClient(Frame,[Link]):
def __init__(self):
[Link].__init__(self)
Frame.__init__(self)
[Link](row=2,column=3)
[Link](width=FALSE,height=FALS
E)
root.option_add("*font",("Calibri",12,"norm
al"))
[Link]('CHATBOX')
[Link] =
Button(self,text="Quit",fg='white',bg="red",
command=[Link],font='Calibri -12 bold')
[Link](row=1,column=3)
[Link]=Button(self,text="Send",fg=
"blue",bg="gray",
command=[Link],font='Calibri -12 bold')
[Link](row=1,column=2)
[Link]=Label(self,text="Message",font='Ca
libri -12 bold')
[Link](row=1,column=0)
[Link] =
Entry(self,width=60,font='Calibri -12 bold')
[Link](row=1,column=1)
[Link] =
Text(self,height=36,width=60,wrap=WORD
,bg="light blue",fg="black")
[Link](row=0,columnspan=4)
[Link]()
[Link]()
2. Runtime of the client
def run(self):
[Link] =
socket(AF_INET,SOCK_STREAM)
[Link](('localhost',3067))
[Link]()
3. Sending of messages from client to
server
def mess(self):
x=[Link]()
[Link](x)
[Link](0,END)
4. Disconnection of the client to the
server
def quits(self):
[Link](END,"\n
Disconnected\n")
[Link]()
#[Link]()
5. Receiving of messages from the
client to server
def recv(self):
while True:
reply = [Link](1024)
[Link](END,"\n"+reply)
if not reply:
[Link](END,"\nConnection
Closed\n")
[Link]()
if __name__=="__main__":
ChatClient().mainloop()