# Bind the socket to the port
server_address = ('localhost', 10000)
print >>sys.stderr, 'starting up on %s port %s' % server_address
sock.bind(server_address)
The error is in the print command.
print >>sys.stderr, 'starting up on %s port %s' % server_address
~~~~~~^^~~~~~~~~~~
TypeError: unsupported operand type(s) for >>: 'builtin_function_or_method' and '_io.TextIOWrapper'. Did you mean "print(<message>, file=<output_stream>)"?```
Is your intention to print the repr of sys.stderr to sys.stdout? You probably meant print('starting up on %s port %s' % server_address, file=sys.stderr).
It seems like you are following a tutorial designed for Python 2. Python 2 is quite old now and has significant incompatibilities with Python 3. I’d suggest using a more recent resource that uses Python 3.