Teaching myself Python Day 6

avatar

Today I was experimenting with some code from @felixxx latest beem tutorial post https://steempeak.com/busy/@felixxx/python-for-steem-3-modules.

Here is the output of the beemaccount.py that I was testing out various beem modules. The Python code is listed below the image.

pylearnday6.png

from beem.account import Account
from beem.blockchain import Blockchain
from beem import Steem
from beem.instance import set_shared_steem_instance

#steemit_api = Steem(node=["https://testnet.steemitdev.com"])
steemit_api = Steem(node=["https://api.steemit.com"])
set_shared_steem_instance(steemit_api)

blockchain = Blockchain()
head_block = blockchain.get_current_block_num()
test_account = Account(account = "mytechtrail")

print(head_block)
print("\n")
print(test_account.balances)
print("\n")
print(test_account.get_balance("available", "VESTS"))
print("\n")
print(test_account.get_voting_power())
print("\n")

for operation in test_account.history_reverse(start = head_block, stop = head_block - 10000, use_block_num = True):
    print(operation)
    print("\n")

This was fun, but shows me how much I need to learn how to work with Python data structures like the dictionary.



0
0
0.000
2 comments
avatar

Learning to code can be fun and excruciating at the same time!
Most of my coding has been around web development so HTML5, CSS3, SASS/LESS, PHP, and Javascript.
Honestly CSS is a hard language to master despite not even being a logical programming language.
I've thought about learning Python, but I haven't had the need for it yet.

0
0
0.000
avatar

I am learning Python mostly for fun and to keep learning something. Although as someone on Steem it is interesting to learn something that I can use to query the blockchain and learn more.

0
0
0.000