from websockets import * import asyncio, json async def msg(): #TODO: Get rid of this boring boilerplate code uri: str = "ws://127.0.0.1:8765" async with connect(uri) as websocket: send: str = input() await websocket.send(send) print(f"Client sent {send}") response: str = await websocket.recv() print(f"Received: {response}") if __name__ == "__main__": asyncio.run(msg())