Question: python sockets ########################### client.py import sockets = socket.socket(socket.AF_INET, socket.SOCK_STREAM)s.connect((socket.gethostname() , 6666))print(socket.gethostname())print(33333333)first = Truefull_msg =''while True: msg = s.recv(800) if len(msg) File Home round 2 Share

python sockets

###########################

client.py

import sockets = socket.socket(socket.AF_INET, socket.SOCK_STREAM)s.connect((socket.gethostname() , 6666))print(socket.gethostname())print("33333333")first = Truefull_msg =''while True: msg = s.recv(800) if len(msg)

server.py import sockets = socket.socket(socket.AF_INET, socket.SOCK_STREAM)s.bind((socket.gethostname() , 6666))print(socket.gethostname())print("33333333")s.listen(5) first = Truea = 0while a

File Home round 2 Share XI Pin to client.py - C:/Users/User/Desktop/new python

File Home round 2 Share XI Pin to client.py - C:/Users/User/Desktop/new python folder/sockets/round 2/client.py (3.7.0) aq File Edit Format Run Options Window Help import socket 3- socket.socket (socket.AF_INET, socket.SOCK_STREAM) 3.connect((socket.gethostname (), 6666)) print (socket.gethostname ()) print ("33333333") first True full_msg" while True: H View Cut msg s.recv (800) if len (msg) < 0: break full_msg + msg.decode("utf-8") print (full_msg) if first-True: DESKTOP-896D683 full msg= first False Command Prompt-client.py Microsoft Windows [Version 10.0.17134.829] (c) 2018 Microsoft Corporation. All rights reserved. 33333333 welcome to the server hi C:\Users\User>CD C:\Users\User\Desktop ew python folder\sockets ound C:\Users\User\Desktop ew python folder\sockets ound 2>client.py Type here to search New item At A 0 OpenSelect all X hi server.py - C:/Users/User/Desktop/new python folder/sockets/round 2/server.py (3.7.0) File Edit Format Run Options Window Help import socket a=socket.socket (socket.AF_INET, socket.SOCK_STREAM) s.bind((socket.gethostname (), 6666)) print (socket.gethostname () ) print ("33333333") s.listen (5) first True a = 0 while a < 1: clientsocket, address s.accept() if first = True: print (str (clientsocket) + "clientsocket") print (str (address) + "address") clientsocket.send (bytes ("welcome to the server","utf-8")) Command Prompt - server.py Microsoft Windows [Version 10.0.17134.829] (c) 2018 Microsoft Corporation. All rights reserved. mag_to_client input () clientsocket.send (bytes (msg_to_client, "utf-8")) first False C:\Users\User>CD C:\Users\User\Desktop ew python folder\sockets ound 2 C:\Users\User\Desktop ew python folder\sockets ound 2>server.py i sent the message hi, but then can no longer type. cmd line only accepts 1 input. i want to be able to keep typing new stuff and the client recieves it. DESKTOP-896D683 33333333

Step by Step Solution

3.45 Rating (152 Votes )

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

The program for serverpy is as follows The program ... View full answer

blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!