From e3a8109d263d3cfaeb8fb9e72ea00aa00a16e6d2 Mon Sep 17 00:00:00 2001 From: Riku Date: Fri, 17 Feb 2023 17:12:40 +0100 Subject: [PATCH] add basic python async getting started example --- content/_code-samples/get-started/py/base.py | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 content/_code-samples/get-started/py/base.py diff --git a/content/_code-samples/get-started/py/base.py b/content/_code-samples/get-started/py/base.py new file mode 100644 index 0000000000..0b33d9b4e9 --- /dev/null +++ b/content/_code-samples/get-started/py/base.py @@ -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()) +