I've been learning interprocess communication. My last project used tempfiles to send data and commands back and forth. Now I want to try using sockets. Can you show me how to make a basic client/server architecture in python using sockets?
Certainly! We can use Python's socket module to communicate between two processes. Here's an example implementation. 

import socket
# server.py

# create  server socket
server_socket = socket.socket(socket.AF_INET, socket.SOCK_STREAM)

# bind the socket to localhost:8000
server_address = ('localhost', 8000)
server_socket.bind(server_address)

# listen for connections
server_socket.listen(1)
print(f"Listening on {server_address}")
client_socket, client_address = server_socket.accept()
print(f"{client_address} connected")

# accept data from client
data = client_socket.recv(1024)
print(f" {data}")

# echo message back to client
client_socket.sendall(f"Message received: {data}".encode('utf-8'))

# close connection
client_socket.close()

...

import socket
# client.py

# create client socket
client_socket = socket.socket(socket.AF_INET, socket.SOCK_STREAM)

# connect the socket to the server
server_address = ('localhost', 8000)
client_socket.connect(server_address)
print(f"Connected to {server_address}")

# say hello to the server
message = "Hello, server!"
client_socket.sendall(message.encode())

# accept response from server
data = client_socket.recv(1024)
print(f" {data.decode()}")

# close connection
client_socket.close()