import socket client_socket = socket.socket(socket.AF_INET, socket.SOCK_STREAM) client_socket.connect(('localhost', 8080)) client_socket.sendall(b"درود سرور!") response = client_socket.recv(1024) print(f"پاسخ از سرور: {response.decode('utf-8')}") client_socket.close()