22 lines
502 B
Python
22 lines
502 B
Python
import socket
|
|
|
|
|
|
def client_program():
|
|
host = "192.168.188.61"
|
|
port = 5000
|
|
|
|
client_socket = socket.socket() # instantiate
|
|
client_socket.connect((host, port)) # connect to the server
|
|
|
|
message = input(" -> ") # take input
|
|
|
|
while message.lower().strip() != 'bye':
|
|
client_socket.send(message.encode()) # send message
|
|
message = input(" -> ") # again take input
|
|
|
|
client_socket.close() # close the connection
|
|
|
|
|
|
if __name__ == '__main__':
|
|
client_program()
|