File: client_version.py

package info (click to toggle)
cloudcompare 2.13.2%2Bgit20240821%2Bds-1
  • links: PTS
  • area: main
  • in suites: trixie
  • size: 151,152 kB
  • sloc: cpp: 687,217; ansic: 165,269; python: 31,109; xml: 25,906; sh: 940; makefile: 509; java: 229; asm: 204; fortran: 160; javascript: 73; perl: 18
file content (14 lines) | stat: -rwxr-xr-x 372 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
#!/usr/bin/env python3

import asyncio
import websockets

async def hello():
    uri = "ws://localhost:6001"
    async with websockets.connect(uri) as websocket:
        await websocket.send('{"jsonrpc": "2.0", "method": "version", "id": 6}')
        result = await websocket.recv()
        print("result: ", result)

asyncio.get_event_loop().run_until_complete(hello())