mirror of
https://github.com/XRPLF/xrpl-dev-portal.git
synced 2025-11-20 19:55:54 +00:00
add basic python async getting started example
This commit is contained in:
16
content/_code-samples/get-started/py/base.py
Normal file
16
content/_code-samples/get-started/py/base.py
Normal file
@@ -0,0 +1,16 @@
|
|||||||
|
import asyncio
|
||||||
|
from xrpl.asyncio.clients import AsyncWebsocketClient
|
||||||
|
|
||||||
|
|
||||||
|
async def main():
|
||||||
|
# Define the network client
|
||||||
|
async with AsyncWebsocketClient("wss://s.altnet.rippletest.net:51233") as client:
|
||||||
|
# inside the context the client is open
|
||||||
|
|
||||||
|
# ... custom code goes here
|
||||||
|
|
||||||
|
# after exiting the context, the client is closed
|
||||||
|
|
||||||
|
|
||||||
|
asyncio.run(main())
|
||||||
|
|
||||||
Reference in New Issue
Block a user