Hello and welcome back, in this article we will continue to develop the cryptocurrency application. In the previous few chapters, we had only used the
At the beginning of the program we will import the exchangerates module as well as get the ticker object from blockchain (rest call).
from blockchain import exchangerates try: ticker = exchangerates.get_ticker() # get the ticker object from blockchain except: print("An exception occurred")
Next, we will comment out the line to use the
for key, value in exchange_rate_s.items(): # populate exchange rate string and the currency tuple #sell_buy += base_crypto + ":" + key + " " + str(value) + "\n" curr1 += (key,)
sell_buy += "Bitcoin : Currency price every 15 minute:" + "\n\n" # print the 15 min price for every bitcoin/currency for k in ticker: sell_buy += "BTC:" + str(k) + " " + str(ticker[k].p15min) + "\n"
If we load the data we will see the below outcome.
If you want to see the entire source code then please go back to the previous chapter to read them.
Are you a developer or a python programmer? Join mine private chat room through this link to see what am I working on right now.