Created
February 5, 2021 08:59
-
-
Save 8wgf3b/805b2ec001cf6014602e1f460a9e6376 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import asyncio | |
import websockets | |
uri = "ws://localhost:5511" | |
async def query(x): | |
async with websockets.connect(uri) as websocket: | |
params = f'ClientResponse `{x}' | |
await websocket.send(params) | |
resp = await websocket.recv() | |
print(resp) | |
asyncio.run(query("A")) | |
# older versions use the following line | |
# asyncio.get_event_loop().run_until_complete(query("A")) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment