Simple Chatting App Using Python and Tkinter

Hello friends,

            Today I Gonna to show you how to create Real-time chatting program with GUI (Graphical User Interface) using python? Or How To create chatting client and server using Python socket, Tkinter and threading module? Or How to create Messaging Program using python example? Etc..


Here, I Created a GUI chat program written in python2.7. It is designed to not need a central server and so work very well on LANs that are not connected to the internet. One user starts the program in server mode, listening on a port of their choosing, and then other users will use client mode to connect to their machine. Each new user then acts as a host, allowing other people to connect to them. 






Here this is an Screenshot captured on Ubuntu

So, what is chat server?

The server is like a middle man among clients. It can queue up to 10 clients. The server broadcasts any messages from a client to the other participants. So, the server provides a sort of chatting room.

The chat server does the following things
1. Accept multiple incoming connections for client.
2. Read incoming messages from each client and broadcast them to all other connected clients.



Now, what is chat client?

client is another important part of connections.
It connects to a remote server, sends messages and receives messages.

The chat client does the following 2 things :
1. Listen for incoming messages from the server.
2. Check user input. If the user types in a message then send it to the server

Features of the program:
1. Cross-Platform Support
2. Easy To Use
3. Easy To Maintain
4. Good Example Of Socket Programming
5. With GUI Its Looks very Simple
6. Light weight
7. etc..etc


Requirements For This Scripts are

1. python Environment
2. Modules:
socket, threading, Tkinter Only


In This Script, I tried to write code that are compatible with python2.7 and python 3.5 also.


For Using This Program, First of all, download code link given below then extract them on a
folder then open scripts names Main-Gui.py.

Then You will see an Small Dialog window asking for server or client mode.

For chatting one user have to select server mode and another user has to select client mode.

If You are using server mode then you have to give your ip address to client mode user for creating a connection between you.

And if You are using client mode: when you will start script on client mode. A dialog box automatically raised and it will ask you about server IP address. Here entered the IP address
of server mode user.

Then click on Connect button and then wait for connection
if script found any connection. The status button will automatically be changed in green color and now you are ready for chatting.

Done!

For More Good Example check this
or Google it.


For Download click here:







WARNING: This code is just a simple demo showing how to use socket in Python Socket module with Tkinter and threading module. it is NOT a complete project that’s why it has many bugs. If you'd like to implement a real chatroom, you should find some other open source projects.




Thanks For Support
Please, Feel Free To Leave A Comment If Our Article has Helped You.
Created By:
S.S.B
surajsinghbisht054@gmail.com

Share this

Related Posts

Previous
Next Post »