#serve server
Import Socket
SK = socket.socket () # instance object
sk.bind (( '127.0.0.1', 8080 )) # is provided within the set of IP and port using the bind method
sk.listen () # monitor information
conn , addr = sk.accept () # received information
the while True:
RET = conn.recv (1024) .decode ( 'UTF-. 8') # receive and decode information is provided directly received an integer multiple of the size of 1024, 1024 can
Print (RET)
IF RET == 'bYE':
conn.send (bytes ( 'goodbye', encoding = 'utf-8 ')) # transmit information, the type of information bytes must
BREAK
RET = INPUT ( '>> > ')
conn.send (bytes (RET, encoding =' UTF-. 8 '))
conn.Close ()
sk.close ()