Programming with python on the steem blockchain-Lesson2- Set up a curation trail
Welcome to my second tutorial on how to program with python on the steem blockchain.
Today I would like to show here how to set up a curation trail with just a few lines of python code, and the usual BEEM library.
For whom that maybe do not know a curation trail is when several accounts, give the posting authority to a designated account, that will perform upvotes on behalf of the participants.
Each single participants keep the total amount of SP owned in their own accounts, so the curation reward earned by the trail is earned by the single participant, as if they cast the votes directly.
I think this way is better than delegations, because once delegated the SP are transferred, and all the rewards goes directly to the delegatee account, that need later to transfer the profits manually to each delegator account.
Sure delegate shows a better support to the final account, so for example with @steemskillshare, if you delegate to the curation account you show a stronger support to the account owner, but in my opinion a strong curation trail shows a stronger support to the community in general.
After these opinions, that I repeat are just my ideas, and you can express yours with a comment on this post if you wish, let's dive into the code.
1. IMPORT THE LIBRARIES AND CONNECT WITH BLOCKCHAIN
As usual, and as you saw already in my previous posts, the very first thing to do with python is eventually import the libraries
from beem import Steem
from beem.vote import Vote
from beem.account import Account
from beem.instance import set_shared_steem_instance
from beem.exceptions import ContentDoesNotExistsException
from beem.comment import Comment
from beem.nodelist import NodeList
These are the specific parts from the beem library that we need for this specific program.
After that, we need to connect with the blockchain
nodelist=NodeList()
nodelist.update_nodes()
stm = Steem(node=nodelist.get_steem_nodes(),keys=[THE PRIV ACTIVE KEY OF THE AUTHORIZED ACCOUNT])
set_shared_steem_instance(stm)
The authorized account is the one that has the authority to vote on behalf of the others, for this example let's imagine it is @steemskillshare
2. DECLARE THE ACCOUNTS
Now it is time to declare all the accounts that gave the authority to the main one, so all the participants of the trail.
name1 = Account("account1",steem_instance=stm)
And you need to create for each account a line like this.
3. DECLARE THE POST TO VOTE AND VOTE IT WITH THE TRAIL
AT this point, we need to actually vote for a post with the trail.
The first thing to do is to say to the program which post to vote.
lk=[write here the post you wish to vote in this format for example: '@the.journal/idea-to-fully-store-a-website-in-the-steem-blockchain']p=Comment(lk, steem_instance=stm)
Be attentive to vote when the post is 5 minutes or older, not to lose the curation reward.
Now we need to create a loop to let the program vote the post with all the accounts of our trail.
Once launched the program will upvote from each single account using the main account key, and in the blockchain will appear as each account voted directly for the post, earning the curation reward for this action
For questions or clarification, I'm available via comments below.
Thanks for your time.

Wow, it was very useful to read. I wish you good luck
sorry for the late reply, and thanks 😊