0% found this document useful (0 votes)
31 views2 pages

Python Socket Programming Example

The document contains Python code for a simple client-server application using sockets. The server listens for connections on localhost at port 5234 and accepts client connections, while the client connects to the server and sends a name. The document also includes references to the college and batch information.

Uploaded by

Abhijit Logavi
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)
31 views2 pages

Python Socket Programming Example

The document contains Python code for a simple client-server application using sockets. The server listens for connections on localhost at port 5234 and accepts client connections, while the client connects to the server and sends a name. The document also includes references to the college and batch information.

Uploaded by

Abhijit Logavi
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

A.

C PATIL COLLEGE OF ENGINEERING PYTHON LAB

Code:
[Link]-
import socket
s= [Link]()
print(“socket Created”)
[Link]((‘localhost’,5234))
[Link](3)
print(‘Waiting for Connections’)
while True:
c,addr=[Link]()
name = [Link](1024).decode()
print(“Cennected with”,addr,name)
#[Link](bytes(‘Welcome to SE Class’),’utf-8’)
[Link]()

[Link]-
import socket
c = [Link]()
[Link]((‘localhost’,5234))
name = input(“Enter your name”)
[Link](bytes(name,’utf-8’))
print([Link](1024).decode())

Batch: S2 Sem IV Page No:


A.C PATIL COLLEGE OF ENGINEERING PYTHON LAB

Output:

[Link] (final output)

You might also like