SlideShare a Scribd company logo
1 of 10
P R E S E N T E D B Y
A . K E E R T H I K A
M . S C ( I T )
NADAR SARAWATHI COLLEGE
OF ARTS AND SCIENCE
SHARING DATA USING SOCKET
 Socket programming is a way of connecting two
nodes on a network to communicate with each other.
One socket(node) listens on a particular port at an
IP, while the other socket reaches out to the other to
form a connection. The server forms the listener
socket while the client reaches out to the server.
They are the real backbones behind web browsing. In
simpler terms, there is a server and a client.
Socket programming is started by importing the
socket library and making a simple socket.
 import socket s = socket.socket(socket.AF_INET,
socket.SOCK_STREAM)
 Here we made a socket instance and passed it two
parameters. The first parameter is AF_INET and
the second one is SOCK_STREAM. AF_INET
refers to the address-family ipv4. The
SOCK_STREAM means connection-oriented TCP
protocol.
Now we can connect to a server using this socket.3
Connecting to a server
Note that if any error occurs during the creation of a
socket then a socket. error is thrown and we can only
connect to a server by knowing its IP. You can find the IP
of the server by using this :
$ ping www.google.comYou can also find the IP using
python:
import socket ip =
socket.gethostbyname('www.google.com') print ipHere is
an example of a script for connecting to Google.
 # An example script to connect to Google using socket
 # programming in Python
 import socket # for socket
 import sys

 try:
 s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
 print ("Socket successfully created")
 except socket.error as err:
 print ("socket creation failed with error %s" %(err))

 # default port for socket
 port = 80

 try:
 host_ip = socket.gethostbyname('www.google.com')
 except socket.gaierror:

 # this means could not resolve the host
 print ("there was an error resolving the host")
 sys.exit()

 # connecting to the server
 s.connect((host_ip, port))

 print ("the socket has successfully connected to google")
 Output :
 Socket successfully created the socket has successfully connected to google on port == 173.194.40.19
Server
A server has a bind() method which binds it to a
specific IP and port so that it can listen to incoming
requests on that IP and port. A server has a listen()
method which puts the server into listening mode.
This allows the server to listen to incoming
connections. And last a server has an accept() and
close() method. The accept method initiates a
connection with the client and the close method
closes the connection with the client.
 # first of all import the socket library
 import socket

 # next create a socket object
 s = socket.socket()
 print ("Socket successfully created")

 # reserve a port on your computer in our
 # case it is 12345 but it can be anything
 port = 12345

 # Next bind to the port
 # we have not typed any ip in the ip field
 # instead we have inputted an empty string
 # this makes the server listen to requests
 # coming from other computers on the network
 s.bind(('', port))
 print ("socket binded to %s" %(port))

 # put the socket into listening mode
 s.listen(5)
 print ("socket is listening")

 # a forever loop until we interrupt it or
 # an error occurs
 while True:

 # Establish connection with client.
 c, addr = s.accept()
 print ('Got connection from', addr )

 # send a thank you message to the client. encoding to send byte type.
 c.send('Thank you for connecting'.encode())

 # Close the connection with the client
 c.close()

 # Breaking once connection closed
 break
 First of all, we import socket which is necessary.
 Then we made a socket object and res
 # first of all import the socket library
 import socket

 # next create a socket object
 s = ()
 print ("Socksocket.socketet successfully created")

 # reserve a port on your computer in our
 # case it is 12345 but it can be anything
 port = 12345

 # Next bind to the port
 # we have not typed any ip in the ip field
 # instead we have inputted an empty string
 # this makes the server listen to requests
 # coming from other computers on the network
 s.bind(('', port))
 print ("socket binded to %s" %(port))

 # put the socket into listening mode
 s.listen(5)
 print ("socket is listening")

 # a forever loop until we interrupt it or
 # an error occurs
 while True:

 # Establish connection with client.
 c, addr = s.accept()
 print ('Got connection from', addr )

 # send a thank you message to the client. encoding to send byte type.
 c.send('Thank you for connecting'.encode())

 # Close the connection with the client
 c.close()


Client
Now we need something with which a server can interact. We
could tenet to the server like this just to know that our server
is working. Type these commands in the terminal:
# start the server $ python server.py # keep the above
terminal open # now open another terminal and type: $
telnet localhost 12345If ‘telnet’ is not recognized. On windows
search windows features and turn on the “telnet client”
feature.
Output :
# in the server.py terminal you will see # this output:
Socket successfully created socket binded to 12345 socket is
listening Got connection from ('127.0.0.1', 52617)# In the
telnet terminal you will get this:
python programming

More Related Content

Similar to python programming

Socket programming-tutorial-sk
Socket programming-tutorial-skSocket programming-tutorial-sk
Socket programming-tutorial-sksureshkarthick37
 
اسلاید اول جلسه یازدهم کلاس پایتون برای هکرهای قانونی
اسلاید اول جلسه یازدهم کلاس پایتون برای هکرهای قانونیاسلاید اول جلسه یازدهم کلاس پایتون برای هکرهای قانونی
اسلاید اول جلسه یازدهم کلاس پایتون برای هکرهای قانونیMohammad Reza Kamalifard
 
Networking & Socket Programming In Java
Networking & Socket Programming In JavaNetworking & Socket Programming In Java
Networking & Socket Programming In JavaAnkur Agrawal
 
Network programming using python
Network programming using pythonNetwork programming using python
Network programming using pythonAli Nezhad
 
INTRODUCTION TO SOCKETS IN COMPUTER NETWORKS DEPT OF CSE.ppt
INTRODUCTION TO SOCKETS IN COMPUTER NETWORKS DEPT OF CSE.pptINTRODUCTION TO SOCKETS IN COMPUTER NETWORKS DEPT OF CSE.ppt
INTRODUCTION TO SOCKETS IN COMPUTER NETWORKS DEPT OF CSE.pptsenthilnathans25
 
Remote Procedure Call
Remote Procedure CallRemote Procedure Call
Remote Procedure CallNadia Nahar
 
Socket Programming - nitish nagar
Socket Programming - nitish nagarSocket Programming - nitish nagar
Socket Programming - nitish nagarNitish Nagar
 
Network programming in java - PPT
Network programming in java - PPTNetwork programming in java - PPT
Network programming in java - PPTkamal kotecha
 
Network programming in Java
Network programming in JavaNetwork programming in Java
Network programming in JavaTushar B Kute
 
Raspberry pi Part 23
Raspberry pi Part 23Raspberry pi Part 23
Raspberry pi Part 23Techvilla
 

Similar to python programming (20)

Unit 8 Java
Unit 8 JavaUnit 8 Java
Unit 8 Java
 
Socket programming-tutorial-sk
Socket programming-tutorial-skSocket programming-tutorial-sk
Socket programming-tutorial-sk
 
اسلاید اول جلسه یازدهم کلاس پایتون برای هکرهای قانونی
اسلاید اول جلسه یازدهم کلاس پایتون برای هکرهای قانونیاسلاید اول جلسه یازدهم کلاس پایتون برای هکرهای قانونی
اسلاید اول جلسه یازدهم کلاس پایتون برای هکرهای قانونی
 
Sockets intro
Sockets introSockets intro
Sockets intro
 
Os 2
Os 2Os 2
Os 2
 
A.java
A.javaA.java
A.java
 
sockets_intro.ppt
sockets_intro.pptsockets_intro.ppt
sockets_intro.ppt
 
Networking & Socket Programming In Java
Networking & Socket Programming In JavaNetworking & Socket Programming In Java
Networking & Socket Programming In Java
 
Network programming using python
Network programming using pythonNetwork programming using python
Network programming using python
 
Npc08
Npc08Npc08
Npc08
 
INTRODUCTION TO SOCKETS IN COMPUTER NETWORKS DEPT OF CSE.ppt
INTRODUCTION TO SOCKETS IN COMPUTER NETWORKS DEPT OF CSE.pptINTRODUCTION TO SOCKETS IN COMPUTER NETWORKS DEPT OF CSE.ppt
INTRODUCTION TO SOCKETS IN COMPUTER NETWORKS DEPT OF CSE.ppt
 
Remote Procedure Call
Remote Procedure CallRemote Procedure Call
Remote Procedure Call
 
Sockets
SocketsSockets
Sockets
 
Socket Programming - nitish nagar
Socket Programming - nitish nagarSocket Programming - nitish nagar
Socket Programming - nitish nagar
 
Socket System Calls
Socket System CallsSocket System Calls
Socket System Calls
 
Network programming in java - PPT
Network programming in java - PPTNetwork programming in java - PPT
Network programming in java - PPT
 
Network programming in Java
Network programming in JavaNetwork programming in Java
Network programming in Java
 
Raspberry pi Part 23
Raspberry pi Part 23Raspberry pi Part 23
Raspberry pi Part 23
 
#1 (TCPvs. UDP)
#1 (TCPvs. UDP)#1 (TCPvs. UDP)
#1 (TCPvs. UDP)
 
Pemrograman Jaringan
Pemrograman JaringanPemrograman Jaringan
Pemrograman Jaringan
 

More from keerthikaA8

object oriented analysis and design
object oriented analysis and designobject oriented analysis and design
object oriented analysis and designkeerthikaA8
 
distribute system.
distribute system.distribute system.
distribute system.keerthikaA8
 
data mining ppt.
data mining ppt.data mining ppt.
data mining ppt.keerthikaA8
 
Artificial intelligence
Artificial intelligenceArtificial intelligence
Artificial intelligencekeerthikaA8
 
Artificial intelligence
Artificial intelligenceArtificial intelligence
Artificial intelligencekeerthikaA8
 
Artificial intelligence.pptx
Artificial intelligence.pptxArtificial intelligence.pptx
Artificial intelligence.pptxkeerthikaA8
 
MESSAGE PASSING MECHANISMS
MESSAGE PASSING  MECHANISMSMESSAGE PASSING  MECHANISMS
MESSAGE PASSING MECHANISMSkeerthikaA8
 
LIFE CYCLE OF SERVLET
LIFE CYCLE OF SERVLETLIFE CYCLE OF SERVLET
LIFE CYCLE OF SERVLETkeerthikaA8
 
FILE TRANSFER PROTOCOL
FILE TRANSFER PROTOCOLFILE TRANSFER PROTOCOL
FILE TRANSFER PROTOCOLkeerthikaA8
 

More from keerthikaA8 (11)

SOFT COMPUTING
SOFT COMPUTINGSOFT COMPUTING
SOFT COMPUTING
 
object oriented analysis and design
object oriented analysis and designobject oriented analysis and design
object oriented analysis and design
 
distribute system.
distribute system.distribute system.
distribute system.
 
data mining ppt.
data mining ppt.data mining ppt.
data mining ppt.
 
Artificial intelligence
Artificial intelligenceArtificial intelligence
Artificial intelligence
 
Artificial intelligence
Artificial intelligenceArtificial intelligence
Artificial intelligence
 
Artificial intelligence.pptx
Artificial intelligence.pptxArtificial intelligence.pptx
Artificial intelligence.pptx
 
MESSAGE PASSING MECHANISMS
MESSAGE PASSING  MECHANISMSMESSAGE PASSING  MECHANISMS
MESSAGE PASSING MECHANISMS
 
LIFE CYCLE OF SERVLET
LIFE CYCLE OF SERVLETLIFE CYCLE OF SERVLET
LIFE CYCLE OF SERVLET
 
FILE TRANSFER PROTOCOL
FILE TRANSFER PROTOCOLFILE TRANSFER PROTOCOL
FILE TRANSFER PROTOCOL
 
GENERAL METHODS
GENERAL METHODSGENERAL METHODS
GENERAL METHODS
 

Recently uploaded

Presiding Officer Training module 2024 lok sabha elections
Presiding Officer Training module 2024 lok sabha electionsPresiding Officer Training module 2024 lok sabha elections
Presiding Officer Training module 2024 lok sabha electionsanshu789521
 
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Sapana Sha
 
mini mental status format.docx
mini    mental       status     format.docxmini    mental       status     format.docx
mini mental status format.docxPoojaSen20
 
A Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformA Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformChameera Dedduwage
 
The basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxThe basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxheathfieldcps1
 
Concept of Vouching. B.Com(Hons) /B.Compdf
Concept of Vouching. B.Com(Hons) /B.CompdfConcept of Vouching. B.Com(Hons) /B.Compdf
Concept of Vouching. B.Com(Hons) /B.CompdfUmakantAnnand
 
Sanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfSanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfsanyamsingh5019
 
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdfBASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdfSoniaTolstoy
 
Separation of Lanthanides/ Lanthanides and Actinides
Separation of Lanthanides/ Lanthanides and ActinidesSeparation of Lanthanides/ Lanthanides and Actinides
Separation of Lanthanides/ Lanthanides and ActinidesFatimaKhan178732
 
Employee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxEmployee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxNirmalaLoungPoorunde1
 
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxSOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxiammrhaywood
 
Paris 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityParis 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityGeoBlogs
 
How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17Celine George
 
How to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptxHow to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptxmanuelaromero2013
 
Mastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory InspectionMastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory InspectionSafetyChain Software
 
_Math 4-Q4 Week 5.pptx Steps in Collecting Data
_Math 4-Q4 Week 5.pptx Steps in Collecting Data_Math 4-Q4 Week 5.pptx Steps in Collecting Data
_Math 4-Q4 Week 5.pptx Steps in Collecting DataJhengPantaleon
 
Science 7 - LAND and SEA BREEZE and its Characteristics
Science 7 - LAND and SEA BREEZE and its CharacteristicsScience 7 - LAND and SEA BREEZE and its Characteristics
Science 7 - LAND and SEA BREEZE and its CharacteristicsKarinaGenton
 
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17Celine George
 

Recently uploaded (20)

Presiding Officer Training module 2024 lok sabha elections
Presiding Officer Training module 2024 lok sabha electionsPresiding Officer Training module 2024 lok sabha elections
Presiding Officer Training module 2024 lok sabha elections
 
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
 
mini mental status format.docx
mini    mental       status     format.docxmini    mental       status     format.docx
mini mental status format.docx
 
A Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformA Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy Reform
 
The basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxThe basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptx
 
Concept of Vouching. B.Com(Hons) /B.Compdf
Concept of Vouching. B.Com(Hons) /B.CompdfConcept of Vouching. B.Com(Hons) /B.Compdf
Concept of Vouching. B.Com(Hons) /B.Compdf
 
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
 
Sanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfSanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdf
 
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdfBASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
 
9953330565 Low Rate Call Girls In Rohini Delhi NCR
9953330565 Low Rate Call Girls In Rohini  Delhi NCR9953330565 Low Rate Call Girls In Rohini  Delhi NCR
9953330565 Low Rate Call Girls In Rohini Delhi NCR
 
Separation of Lanthanides/ Lanthanides and Actinides
Separation of Lanthanides/ Lanthanides and ActinidesSeparation of Lanthanides/ Lanthanides and Actinides
Separation of Lanthanides/ Lanthanides and Actinides
 
Employee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxEmployee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptx
 
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxSOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
 
Paris 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityParis 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activity
 
How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17
 
How to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptxHow to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptx
 
Mastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory InspectionMastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory Inspection
 
_Math 4-Q4 Week 5.pptx Steps in Collecting Data
_Math 4-Q4 Week 5.pptx Steps in Collecting Data_Math 4-Q4 Week 5.pptx Steps in Collecting Data
_Math 4-Q4 Week 5.pptx Steps in Collecting Data
 
Science 7 - LAND and SEA BREEZE and its Characteristics
Science 7 - LAND and SEA BREEZE and its CharacteristicsScience 7 - LAND and SEA BREEZE and its Characteristics
Science 7 - LAND and SEA BREEZE and its Characteristics
 
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
 

python programming

  • 1. P R E S E N T E D B Y A . K E E R T H I K A M . S C ( I T ) NADAR SARAWATHI COLLEGE OF ARTS AND SCIENCE
  • 2. SHARING DATA USING SOCKET  Socket programming is a way of connecting two nodes on a network to communicate with each other. One socket(node) listens on a particular port at an IP, while the other socket reaches out to the other to form a connection. The server forms the listener socket while the client reaches out to the server. They are the real backbones behind web browsing. In simpler terms, there is a server and a client. Socket programming is started by importing the socket library and making a simple socket.
  • 3.  import socket s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)  Here we made a socket instance and passed it two parameters. The first parameter is AF_INET and the second one is SOCK_STREAM. AF_INET refers to the address-family ipv4. The SOCK_STREAM means connection-oriented TCP protocol. Now we can connect to a server using this socket.3
  • 4. Connecting to a server Note that if any error occurs during the creation of a socket then a socket. error is thrown and we can only connect to a server by knowing its IP. You can find the IP of the server by using this : $ ping www.google.comYou can also find the IP using python: import socket ip = socket.gethostbyname('www.google.com') print ipHere is an example of a script for connecting to Google.
  • 5.  # An example script to connect to Google using socket  # programming in Python  import socket # for socket  import sys   try:  s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)  print ("Socket successfully created")  except socket.error as err:  print ("socket creation failed with error %s" %(err))   # default port for socket  port = 80   try:  host_ip = socket.gethostbyname('www.google.com')  except socket.gaierror:   # this means could not resolve the host  print ("there was an error resolving the host")  sys.exit()   # connecting to the server  s.connect((host_ip, port))   print ("the socket has successfully connected to google")  Output :  Socket successfully created the socket has successfully connected to google on port == 173.194.40.19
  • 6. Server A server has a bind() method which binds it to a specific IP and port so that it can listen to incoming requests on that IP and port. A server has a listen() method which puts the server into listening mode. This allows the server to listen to incoming connections. And last a server has an accept() and close() method. The accept method initiates a connection with the client and the close method closes the connection with the client.
  • 7.  # first of all import the socket library  import socket   # next create a socket object  s = socket.socket()  print ("Socket successfully created")   # reserve a port on your computer in our  # case it is 12345 but it can be anything  port = 12345   # Next bind to the port  # we have not typed any ip in the ip field  # instead we have inputted an empty string  # this makes the server listen to requests  # coming from other computers on the network  s.bind(('', port))  print ("socket binded to %s" %(port))   # put the socket into listening mode  s.listen(5)  print ("socket is listening")   # a forever loop until we interrupt it or  # an error occurs  while True:   # Establish connection with client.  c, addr = s.accept()  print ('Got connection from', addr )   # send a thank you message to the client. encoding to send byte type.  c.send('Thank you for connecting'.encode())   # Close the connection with the client  c.close()   # Breaking once connection closed  break  First of all, we import socket which is necessary.  Then we made a socket object and res
  • 8.  # first of all import the socket library  import socket   # next create a socket object  s = ()  print ("Socksocket.socketet successfully created")   # reserve a port on your computer in our  # case it is 12345 but it can be anything  port = 12345   # Next bind to the port  # we have not typed any ip in the ip field  # instead we have inputted an empty string  # this makes the server listen to requests  # coming from other computers on the network  s.bind(('', port))  print ("socket binded to %s" %(port))   # put the socket into listening mode  s.listen(5)  print ("socket is listening")   # a forever loop until we interrupt it or  # an error occurs  while True:   # Establish connection with client.  c, addr = s.accept()  print ('Got connection from', addr )   # send a thank you message to the client. encoding to send byte type.  c.send('Thank you for connecting'.encode())   # Close the connection with the client  c.close()  
  • 9. Client Now we need something with which a server can interact. We could tenet to the server like this just to know that our server is working. Type these commands in the terminal: # start the server $ python server.py # keep the above terminal open # now open another terminal and type: $ telnet localhost 12345If ‘telnet’ is not recognized. On windows search windows features and turn on the “telnet client” feature. Output : # in the server.py terminal you will see # this output: Socket successfully created socket binded to 12345 socket is listening Got connection from ('127.0.0.1', 52617)# In the telnet terminal you will get this: