Hello! I am learning to program in Python, so I apologize in advance for perhaps stupid question. Is it possible to do the following: 1. In one console (I mean my Pythonanywhere bash concoles) start the server, that listens port on the local machine. 2 In another console - the client, that interacts with the server. I've tried to run examples from Python documentation, items 22.214.171.124.1-2.
19:55 ~/asyncio $ python3 call_back_style_TCP_Server.py
Serving on ('127.0.0.1', 8886)
19:58 ~/asyncio $ python call_back_style_TCP_Client.py
Traceback (most recent call last):
File "call_back_style_TCP_Client.py", line 24, in <module> loop.run_until_complete(coro)
File "/usr/lib/python3.6/asyncio/base_events.py", line 466, in run_until_complete return future.result()
File "/usr/lib/python3.6/asyncio/base_events.py", line 776, in create_connection raise exceptions
File "/usr/lib/python3.6/asyncio/base_events.py", line 763, in create_connection yield from self.sock_connect(sock, address)
File "/usr/lib/python3.6/asyncio/selector_events.py", line 451, in sock_connect return (yield from fut)
File "/usr/lib/python3.6/asyncio/selector_events.py", line 481, in _sock_connect_cb raise OSError(err, 'Connect call failed %s' % (address,))
ConnectionRefusedError: [Errno 111] Connect call failed ('127.0.0.1', 8886)
What i've done wrong? Thanks in advance.