#!/usr/bin/python3 # -*- coding: utf-8 -*- import socket # Init: client needs to know which IP:port to connect to server_port = 12000 server_name = "127.0.0.1" # SOCK_STREAM says TCP, SOCK_DRAM says UDP client_socket = socket.socket(family=socket.AF_INET, type=socket.SOCK_STREAM) # Actually create the tunnel client_socket.connect((server_name, server_port)) # input and send to server sentence = input("Input lowercase sentence:") client_socket.send(sentence.encode()) # receive from server and print modified_sentence = client_socket.recv(1024) print("From Server:", modified_sentence.decode()) client_socket.close()