From c82d96fce005e6c4b5b8a248c2e70f409aaa5ead Mon Sep 17 00:00:00 2001 From: inertia <amartin75@gmail.com> Date: Wed, 9 Jun 2021 11:23:04 -0700 Subject: [PATCH] #44 python live code examples --- _tutorials-python/account_reputation.md | 8 ++++++++ _tutorials-python/get_account_comments.md | 8 +++++++- _tutorials-python/get_account_replies.md | 8 ++++++++ _tutorials-python/get_delegations_by_user.md | 8 ++++++++ _tutorials-python/get_follower_and_following_list.md | 8 ++++++++ _tutorials-python/get_post_comments.md | 8 +++++++- _tutorials-python/get_post_details.md | 8 ++++++++ _tutorials-python/get_posts.md | 8 +++++++- _tutorials-python/get_voters_list_on_post.md | 8 ++++++++ _tutorials-python/rcdemo.md | 8 ++++++++ _tutorials-python/search_accounts.md | 8 +++++++- _tutorials-python/stream_blockchain_transactions.md | 8 ++++++++ 12 files changed, 92 insertions(+), 4 deletions(-) diff --git a/_tutorials-python/account_reputation.md b/_tutorials-python/account_reputation.md index fdad4d82..bdb16d39 100644 --- a/_tutorials-python/account_reputation.md +++ b/_tutorials-python/account_reputation.md @@ -103,6 +103,14 @@ if sign < 0: You can use this to convert from the raw blockchain value. This is now done internally by libraries like beem. +--- + +#### Try it + +Click the play button below: + +<iframe height="400px" width="100%" src="https://replit.com/@inertia186/py20accountreputation?embed=1&output=1" scrolling="no" frameborder="no" allowtransparency="true" allowfullscreen="true" sandbox="allow-forms allow-pointer-lock allow-popups allow-same-origin allow-scripts allow-modals"></iframe> + ### To Run the tutorial 1. [review dev requirements](getting_started.html) diff --git a/_tutorials-python/get_account_comments.md b/_tutorials-python/get_account_comments.md index 0174a326..08381b02 100644 --- a/_tutorials-python/get_account_comments.md +++ b/_tutorials-python/get_account_comments.md @@ -104,7 +104,13 @@ The example of result returned from the service is a `JSON` object with the foll From this result you have access to everything associated to the [comments](https://beem.readthedocs.io/en/latest/beem.comment.html#beem.comment.Comment) of account including content of comment, timestamp, active_votes, etc., so that you can use in further development of your applications with Python. -That's it! +--- + +#### Try it + +Click the play button below: + +<iframe height="400px" width="100%" src="https://replit.com/@inertia186/py09getaccountcomments?embed=1&output=1" scrolling="no" frameborder="no" allowtransparency="true" allowfullscreen="true" sandbox="allow-forms allow-pointer-lock allow-popups allow-same-origin allow-scripts allow-modals"></iframe> ### To Run the tutorial diff --git a/_tutorials-python/get_account_replies.md b/_tutorials-python/get_account_replies.md index b5347cde..56d5dd69 100644 --- a/_tutorials-python/get_account_replies.md +++ b/_tutorials-python/get_account_replies.md @@ -97,6 +97,14 @@ for reply in replies: pprint.pprint(reply.body) ``` +--- + +#### Try it + +Click the play button below: + +<iframe height="400px" width="100%" src="https://replit.com/@inertia186/py08getaccountreplies?embed=1&output=1" scrolling="no" frameborder="no" allowtransparency="true" allowfullscreen="true" sandbox="allow-forms allow-pointer-lock allow-popups allow-same-origin allow-scripts allow-modals"></iframe> + ### To Run the tutorial 1. [review dev requirements](getting_started.html) diff --git a/_tutorials-python/get_delegations_by_user.md b/_tutorials-python/get_delegations_by_user.md index da2158d6..e1dfffe5 100644 --- a/_tutorials-python/get_delegations_by_user.md +++ b/_tutorials-python/get_delegations_by_user.md @@ -105,6 +105,14 @@ For both the queries the starting points were defined in such a way as to includ Note that we output the delegated amounts as HIVE Power, in keeping with the principle of only interacting with the end user in terms of HIVE Power, which is the recommended best practice. +--- + +#### Try it + +Click the play button below: + +<iframe height="400px" width="100%" src="https://replit.com/@inertia186/py29getdelegationsbyuser?embed=1&output=1" scrolling="no" frameborder="no" allowtransparency="true" allowfullscreen="true" sandbox="allow-forms allow-pointer-lock allow-popups allow-same-origin allow-scripts allow-modals"></iframe> + ### To Run the tutorial 1. [review dev requirements](getting_started.html) diff --git a/_tutorials-python/get_follower_and_following_list.md b/_tutorials-python/get_follower_and_following_list.md index 3e015823..de3293e1 100644 --- a/_tutorials-python/get_follower_and_following_list.md +++ b/_tutorials-python/get_follower_and_following_list.md @@ -106,6 +106,14 @@ print(*follows, sep='\n') This is a fairly simple example of how to use these functions but we encourage you to play around with the parameters to gain further understanding of possible results. +--- + +#### Try it + +Click the play button below: + +<iframe height="400px" width="100%" src="https://replit.com/@inertia186/py19getfollowerandfollowinglist?embed=1&output=1" scrolling="no" frameborder="no" allowtransparency="true" allowfullscreen="true" sandbox="allow-forms allow-pointer-lock allow-popups allow-same-origin allow-scripts allow-modals"></iframe> + ### To Run the tutorial 1. [review dev requirements](getting_started.html) diff --git a/_tutorials-python/get_post_comments.md b/_tutorials-python/get_post_comments.md index 6a144fcd..0a8b5ba7 100644 --- a/_tutorials-python/get_post_comments.md +++ b/_tutorials-python/get_post_comments.md @@ -110,7 +110,13 @@ The example of results returned from the service: From this result you have access to everything associated to the replies including content of reply, author, timestamp, etc., so that you can be use in further development of applications with Python. -That's it! +--- + +#### Try it + +Click the play button below: + +<iframe height="400px" width="100%" src="https://replit.com/@inertia186/py07getpostcomments?embed=1&output=1" scrolling="no" frameborder="no" allowtransparency="true" allowfullscreen="true" sandbox="allow-forms allow-pointer-lock allow-popups allow-same-origin allow-scripts allow-modals"></iframe> ### To Run the tutorial diff --git a/_tutorials-python/get_post_details.md b/_tutorials-python/get_post_details.md index 3a80692c..a72deee3 100644 --- a/_tutorials-python/get_post_details.md +++ b/_tutorials-python/get_post_details.md @@ -104,6 +104,14 @@ The example of result returned from the service: From this result you have access to everything associated to the post including additional metadata which is a `JSON` string (e.g.; `json()["created"]`), `active_votes` (see: [beem.comment.Comment.get_vote_with_curation](https://beem.readthedocs.io/en/latest/beem.comment.html#beem.comment.Comment.get_vote_with_curation)) info, post title, body, etc. details that can be used in further development of applications with Python. +--- + +#### Try it + +Click the play button below: + +<iframe height="400px" width="100%" src="https://replit.com/@inertia186/py05getpostdetails?embed=1&output=1" scrolling="no" frameborder="no" allowtransparency="true" allowfullscreen="true" sandbox="allow-forms allow-pointer-lock allow-popups allow-same-origin allow-scripts allow-modals"></iframe> + ### To Run the tutorial 1. [review dev requirements](getting_started.html) diff --git a/_tutorials-python/get_posts.md b/_tutorials-python/get_posts.md index e9ec1dc7..7d0bcf64 100644 --- a/_tutorials-python/get_posts.md +++ b/_tutorials-python/get_posts.md @@ -95,7 +95,13 @@ The example of result returned from the service as objects: From this result you have access to everything associated to the posts including additional metadata which is a `JSON` string (that must be decoded to use), `active_votes` info, post title, body, etc. details that can be used in further development of application with Python. -That's it! +--- + +#### Try it + +Click the play button below: + +<iframe height="400px" width="100%" src="https://replit.com/@inertia186/py04getposts?embed=1&output=1" scrolling="no" frameborder="no" allowtransparency="true" allowfullscreen="true" sandbox="allow-forms allow-pointer-lock allow-popups allow-same-origin allow-scripts allow-modals"></iframe> ### To Run the tutorial diff --git a/_tutorials-python/get_voters_list_on_post.md b/_tutorials-python/get_voters_list_on_post.md index 6ee6313d..7157930c 100644 --- a/_tutorials-python/get_voters_list_on_post.md +++ b/_tutorials-python/get_voters_list_on_post.md @@ -101,6 +101,14 @@ The example of result returned from the service is a table with the following ou From this result you have access to everything associated to the voter including reputation of voter, timestamp, voter's account name, percent and weight of vote, rshares reward shares values that you can be use in further development of applications with Python. +--- + +#### Try it + +Click the play button below: + +<iframe height="400px" width="100%" src="https://replit.com/@inertia186/py06getvoterslistonpost?embed=1&output=1" scrolling="no" frameborder="no" allowtransparency="true" allowfullscreen="true" sandbox="allow-forms allow-pointer-lock allow-popups allow-same-origin allow-scripts allow-modals"></iframe> + ### To Run the tutorial 1. [review dev requirements](getting_started.html) diff --git a/_tutorials-python/rcdemo.md b/_tutorials-python/rcdemo.md index bcb13717..ab1d7d21 100644 --- a/_tutorials-python/rcdemo.md +++ b/_tutorials-python/rcdemo.md @@ -130,6 +130,14 @@ convenience of asking `hived` to report these values. As you can see, integrating support for the RC system into a Hive client library involves a number of architectural and technical decisions. +--- + +#### Try it + +Click the play button below: + +<iframe height="400px" width="100%" src="https://replit.com/@inertia186/py36rcdemo?embed=1&output=1" scrolling="no" frameborder="no" allowtransparency="true" allowfullscreen="true" sandbox="allow-forms allow-pointer-lock allow-popups allow-same-origin allow-scripts allow-modals"></iframe> + ### To Run the tutorial 1. [review dev requirements](getting_started.html) diff --git a/_tutorials-python/search_accounts.md b/_tutorials-python/search_accounts.md index a4d1fd51..e1a85a57 100644 --- a/_tutorials-python/search_accounts.md +++ b/_tutorials-python/search_accounts.md @@ -96,7 +96,13 @@ else: The query returns an array of objects. We use the `for` loop to build a list of only the tag `names` from that array and then display the list on the UI with line separators. This creates an easy to read list of tags. -That's it!. +--- + +#### Try it + +Click the play button below: + +<iframe height="400px" width="100%" src="https://replit.com/@inertia186/py15searchaccounts?embed=1&output=1" scrolling="no" frameborder="no" allowtransparency="true" allowfullscreen="true" sandbox="allow-forms allow-pointer-lock allow-popups allow-same-origin allow-scripts allow-modals"></iframe> ### To Run the tutorial diff --git a/_tutorials-python/stream_blockchain_transactions.md b/_tutorials-python/stream_blockchain_transactions.md index cabbcf62..6d1e4677 100644 --- a/_tutorials-python/stream_blockchain_transactions.md +++ b/_tutorials-python/stream_blockchain_transactions.md @@ -74,6 +74,14 @@ walterprofe authored a post: LÃmites 01 Introducción poshbot replied to prydefoltz ``` +--- + +#### Try it + +Click the play button below: + +<iframe height="400px" width="100%" src="https://replit.com/@inertia186/py13streamblockchaintransactions?embed=1&output=1" scrolling="no" frameborder="no" allowtransparency="true" allowfullscreen="true" sandbox="allow-forms allow-pointer-lock allow-popups allow-same-origin allow-scripts allow-modals"></iframe> + ### To Run the tutorial 1. [review dev requirements](getting_started.html) -- GitLab