PWP With Dates
PWP With Dates
Micro-Project
Academic Year 2024-25
o Course name: Computer Engineering
o Title of Microproject: Chat GUI using Python
o Course Code: 22616
o Course Co-ordinator: Mrs. Namrata Suryawanshi
Microproject Report
Part A Part B
Name of Program: Diploma in Computer Engineering
Sagar Jadhav
Vaishnavi Matkar
Om Swami
Maharashtra State
Board of Technical Education, Mumbai
(Autonomous) (ISO-9001-2008) (ISO/IEC 27001:2013)
CERTIFICATE
This is to certify that Mr/Mrs. 210-Janhavi More, 198-Vaishnavi Matkar, 201-Om Swami,
205-Sagar Jadhav of Diploma in Computer Engineering of Pimpri-Chinchwad Polytechnic
has completed Micro projects of the course Programming with Python (22616) as
prescribed in the curriculum for the academic year 2024-25.
Place: Akurdi
Date:
Seal of institute
PART-A
Micro Project Proposal
Description:
This project involves developing a chat application using Python's socket and threading
libraries for server-client communication and the Tkinter library for the GUI. The server
manages multiple clients, while the client-side interface allows users to send and receive
messages in real-time. The application supports personalized greetings and efficient
message broadcasting.
Proposed methodology:
Design and implement a server using the socket and threading libraries to handle
multiple clients.
Develop a Tkinter-based GUI for the client-side application to send and receive
messages.
Implement message broadcasting and personalized responses.
Test the application for robustness in multi-client scenarios.
Action Plan:
SR. DETAILS OF PLANNED PLANNED NAME OF
NO ACTIVITY START FINISHED RESPONSIBLE
DATE DATE TEAM MEMBER
1. Topic given by subject 1/1/25 8/1/25
teacher and discussed Janhavi More
with given members.
PART-B
Micro Project Proposal
Introduction: This project explores the development of a Chat GUI using Python,
emphasizing real-time communication and user-friendly interface design. It demonstrates
the integration of socket programming and GUI development using Tkinter.
Aims/benefits of the micro-project:
Aim:- To develop a real-time chat application with a GUI using Python's socket,
threading, and Tkinter libraries.
Benefits:-
Literature Review:
Previous studies and projects have highlighted the importance of real-time communication
systems in various applications. Python's socket and Tkinter libraries have been widely used
for developing such systems due to their simplicity and efficiency. This project builds on
these concepts, incorporating multi-threading for handling concurrent clients and a user-
friendly GUI for an enhanced chat experience.
Actual resources Used:
Sr.no Name of the resources Specification Remarks
1. Computer System OS: Windows 10, RAM:8GB Used
2. Software PyCharm Community Edition Used
3. Website www.tutorialspoint.com Used
Program Code:
Server.py
import socket
import threading
class ChatServer:
def __init__(self):
self.host = "127.0.0.1" # Localhost
self.port = 5555
self.server_socket = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
self.server_socket.bind((self.host, self.port))
self.server_socket.listen(5)
print("Server started. Waiting for connections...")
self.clients = []
def broadcast(self, message, sender_socket):
try:
message = client_socket.recv(1024).decode("utf-8")
print(f"Received: {message}")
if message.lower().startswith("hello, i am"):
self.broadcast(message.encode("utf-8"), client_socket)
except ConnectionResetError:
print("Client disconnected.")
self.clients.remove(client_socket)
client_socket.close()
break
def run(self):
while True:
client_socket, client_address = self.server_socket.accept()
server.run()
client-gui.py
import socket
import threading
from tkinter import Tk, Text, Scrollbar, Entry, Button, Label, Frame, END, RIGHT, Y, DISABLED,
NORMAL
class ChatClient:
def __init__(self, root):
self.root = root
self.root.title("Chat Application")
self.root.geometry("500x600")
self.root.configure(bg="#2C3E50")
self.header = Label(root, text="Welcome to the Chat Room", font=("Helvetica", 16,
"bold"), bg="#34495E", fg="white", pady=10)
self.header.pack(fill="x")
self.client_socket.send(message.encode("utf-8"))
self.display_message(f"You: {message}")
if message.lower() == "exit":
self.running = False
self.root.quit()
self.input_frame.clear_message()
def receive_messages(self):
while self.running:
try:
message = self.client_socket.recv(1024).decode("utf-8")
self.display_message(f"Server: {message}")
except:
break
def display_message(self, message):
self.chat_area.config(state=NORMAL)
self.chat_area.insert(END, message + "\n")
self.chat_area.config(state=DISABLED)
self.chat_area.see(END) # Scroll to the bottom
def on_close(self):
self.running = False
self.client_socket.send("exit".encode("utf-8"))
self.client_socket.close()
self.root.quit()
class EntryFrame(Frame):
def __init__(self, parent, send_callback):
super().__init__(parent, bg="#2C3E50") # Initialize as a Frame
self.entry = Entry(self, width=40, font=("Arial", 12), bg="#ECF0F1", fg="#2C3E50")
self.entry.grid(row=0, column=0, padx=5)
def get_message(self):
return self.entry.get()
def clear_message(self):
self.entry.delete(0, END)
if __name__ == "__main__":
root = Tk()
client = ChatClient(root)
root.protocol("WM_DELETE_WINDOW", client.on_close)
Action Plan:
SR. DETAILS OF PLANNED PLANNED NAME OF
NO ACTIVITY START FINISHED RESPONSIBLE
DATE DATE TEAM MEMBER
1. Topic given by subject 12/3/25 19/3/25
teacher and discussed Janhavi More
with given members.