0% found this document useful (0 votes)
63 views12 pages

XII CS Project File

The certificate recognizes that Md. Moinuddin Patel, a class XII student

Uploaded by

vinodkumar patel
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
63 views12 pages

XII CS Project File

The certificate recognizes that Md. Moinuddin Patel, a class XII student

Uploaded by

vinodkumar patel
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 12

Bal Bharati

PUBLIC SCH0OL
..

Computer Science Project


Year: 2019-20
Topic:-Chatting App

Name:-MD.Moinuddin Patel
Class:-XII
Reg. No:-11604145
Faculty:-Mr.Anustup Gupta
BalBal Bharati
PUBLIC SCHOOL
SCH0OL CODE: 03097

NTPC, JHANOR, BHARUCH (GUJARAT)

THIS CERTIFIES THAT

MASTER/MISS Md. MeinuddinPathl


Of Standard XIl, bonafide student of Bal Bharati Public

School, NTPC Jhanor has satisfactorily completed his/her

Project on

Chalina hpp
Registration Number/Board's Roll Number: 1L60tL45 sfolte
wwwwn
oloiw
Subject Principal Exterhal Examiner
Teacher ARAT
L PUBL
N . 430

SC
NTPCHANO
ACKNOWLEDGEMENT
wish to express my gratitude and sincere
thanks to Mr. Kalpesh Kayasth, Principal, Bal
Bharati Public School, for his
encouragement and for the facilities that he
has provided for this project work. I sincerely
appreciate his magnanimity by taking me into
his fold for which I shall remain indebted to
him.
lalso extend my hearty thanks to Mr. Anustup
Gupta, Computer Science teacher who
guided me to successful completion of this
project. I take this opportunity to express my
deep sense of gratitude for his valuable
guidance, constant encouragement,
Constructive comments, sympathetic
attitude and immense motivation, which has
sustained my efforts at all stages of this
project work.

Name: Md. Moinuddin

Sign:-M Date:-15/21
INDEX
SR.NO Assignment Page
No.
1) Certificate Of 2
Excellence

2) Acknowledgement 3

3) Aim Of The Project 5

4) Introduction 6-7

5) Source Code 8-18

6) Snapshot Proof 19

7) Bibliography 20
O Aim Of The Projectt
To make a chatting application from
python programming language.

o o o
(o o o

wON
INTRODUCTION
Here,I Created a GUI chat program written in python2.7. Itis
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.

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 soort
of chatting room.

The chat server doesthe 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.

VON
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.

Requirements For This Scripts are:


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

In This Script, I tried to write code that is compatible with


python2.7 and python 3.5 also.

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 colour and now you are
ready for chatting.

VON
Source Code
##Module1(Ask_IP.py)
#Here Importing Module
try:
import Tkinter, ttk
except:
import tkinter as Tkinter
import tkinter.ttk as ttk

PORT ="5000"
text="
Server IP Address
Enter Ip Address Of Server You Want To Connect.
Server PORT Number :
Enter PORT Number Of Connection You want to use
5000 is default port. if you want to change then change
from configurations settings.

def Ask Ip(var, var1):


mainrootTkinter.Toplevel()
mainroot. title("Enter lp Address")
mainroot.resizable(0,0)
mainroot.focus force()
mainroot.transient()
root-ttk.Frame(mainroot)
root.pack(padx=10, pady=10)
#var=Tkinter.String Var()
#var1=Tkinter.IntVar()
var1.set(PORT)
ttk.Label(root, text='Server IP Address:',width=25).grid(row=1, column=1)
ttk.Label(root, text='Server PORT Number:', width=25).grid(row=2, column=1)
k=ttk.Entry(root, textvariable=var, width=25)
k.grid(row=1, column=2)
k.focus force()
Tkinter.Entry(root, text=var1,state="disabled', width=25)-grid(row2,
column=2)
Label=Tkinter.Textfroot, width=70, height=4, font=('arial 8 italic')
Label.insert('1.0',text,'end")
Label.grid(row=3, column=1,columnspan=2, rowspan=4)
Label.comfig(state=disabled')
ttk.Button(root, text="Next", command=lambda: mainroot.destroy0.
width-25).grid(row=8, column=2)
mainroot.mainloop()

if_name_==_main_:
Ask_Ip()
##Module2(Ask_Mode.py)
try:
import Tkinter, ttk
except:
import tkinter as Tkinter
import tkinter.ttk as ttk

PROGRAM NAME="Choose Mode"


text"
Client Mode [Default:
Here Your Machine will Search Server Connection.
Server Mode:
Here Your Machine will wait For Client Connection

def Ask Mode Option(0:


root Tkinter.Tk(class Name=PROGRAM_NAME)
mode=Tkinter.IntVar)
mode.set(3)
#0 for Client Mode
# 1 For Server Mode
def out() e
root.destroy()
return
def mode set(value):
mode.set(value)
out()
return

frame-ttk.LabelFrame(root, text="Choose Your Option")


frame.pack(side="top',padx=10,pady=10, ipady=10, ipadx=10)
ttk.Button(frame, text="Client Mode', command=lambda:
mode pady=10)
set(0)).grid(row=1, column=1, padx=10,command=lambda:
ttk.Button(frame, text="Server Mode',
mode set(1)).grid(row=1, column=2, padx=10, pady=10)
ttk.Button(frame, text="Exit ", command=out).grid(row=1, column=3)
# Description About Modes
Label=Tkinter.Textframe, width=60, height=4, font=('arial 8 italic'))

Label.insert(1.0",text,'end')
Label.grid(row=3, column=1, columnspan=4, rowspan=5, padx=10,
pady=10)
Label.config(state="disabled')
root.mainloop()
return mode.get)
# Trigger For Script
if_name_smain_'
print(AskMode Option())
#Main_Program(Main-GUi.py)
import Ask_Mode as ask, ServerMode as server, ClientMode as client
ifname_=='main
storeobj=ask.Ask_Mode_Option()
if storeobj==0:
client.ClientMode(className="Python Chatting [Client
Mode]).mainloop()
pass
elif storeobj==:
server.ServerMode(class Name='Python Chatting [Server
Mode]').mainloop()
pass
else
pass

VON
Screenshot Proofs

EMETY
e: 58: 0 VIAIN
Dvthon3 python3 EMPTY EMPTY

O IOOtaMaster-Hunter:-/Desktop/Chattingh
cd Scripts_store
ls
-/Desktop/chatting/scIipts_storea
D0o2 lnux DNTOOt@Master-Hun ter :
Main-GU1.py
Pycache
S e r v e r M o d e . py
1 e
ServerMode . py
ang Pen i a :
op/Chatting/ScIipts_store# pyth

Other!h

i t1. mo: hi
Completed
me: How aro You?

OUher Fine!!
me: What are You Doing 7?

Other Chaning wth You iol

'o
12'a 4 s '6 7 a 9
ENTEP
QWER T UID Pt
ASDF GHJ K

C V B N M
SHIFT

Usage
A"******* Cen m
reyOu Len gt e p o aiy ject by
stertcd j--0

elif torerudj* Iep cari aFo to shiATI utonatcaly afte


r a t psentreis nest to an otrct
Tou n d t i v a ' a tfira Cetidvicr n

Oher

y r l p t , "trealts" cr e r **
Fin
Orher Wnal 3re Yo DO
N: ChIay wtn Youol
I1:atilri

( nes Is Casite
ir *

Atriun Is (irts
BIBLIOGRAPHY
. Comprehensive Computer Science Class 12
Textbook
I. Tkinter GUI Application Development
Blueprints, Second Edition: Build nine
I. www.stackoverflow.com
IV. www.google.comn

T T TI '/1we.

O9.hns1n

Tat 2

You might also like