Absolutely!  Sockets in Python are used for communication between two computers. We'll use the socket library to make this happen.

In our example, there are two parts: a server and a client.  The server waits for the client to connect, and the client connects to the server.

Server:

	import socket

	server_socket = socket.socket(socket.AF_INET, socket.SOCK_STREAM)

	host = '127.0.0.1'
	port = 12345
	server_socket.bind((host, port))

	server_socket.listen(1)
	print("Server is waiting...")

	client_socket, addr = server_socket.accept()
	print(f"Client connected from {addr}")

	client_socket.close()
	server_socket.close()

Client:

	import socket

	client_socket = socket.socket(socket.AF_INET, socket.SOCK_STREAM)

	host = '127.0.0.1'
	port = 12345
	client_socket.connect((host, port))
	print("Connected to server!")

	client_socket.close()

The server and client can now connect. To send messages, explore `send()` and `recv()` methods.  Have fun learning more about sockets!
spam fails_task lang_mismatch pii not_appropriate hate_speech sexual_content quality toxicity humor helpfulness creativity violence