Advertisement
Guest User

Untitled

a guest
Mar 9th, 2018
3,933
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 1.17 KB | None | 0 0
  1. import json
  2. import os
  3. import threading
  4. from kucoin.client import Client
  5.  
  6.  
  7. ########### Credentials #################
  8. api_key = ""
  9. api_secret = ""
  10. client = Client(api_key, api_secret)
  11. #########################################
  12.  
  13. ########### Currency Update Function #############
  14. #Timer Setup
  15. def printit():
  16.   threading.Timer(1.0, printit).start()
  17.   pull = client.get_tick()
  18.   coinType = pull[1]['coinType']   #Gets Coin Type(Name)
  19.   buyPrice = pull[1]['buy']        #Gets Buy Price
  20.   sellPrice = pull[1]['sell']      #Sell Price
  21.   changerate = pull[1]['changeRate'] #Change Rate
  22.   change = pull[1]['change']       #Change Price
  23.   high = pull[1]['high']           #Change Daily High
  24.   low = pull[1]['low']             #Change Daily Low
  25.  
  26.  
  27.   os.system('cls')
  28.   print('Coin: {0}'.format(coinType))
  29.   print('Bitcoin BUYPRICE:  ${0}'.format(buyPrice))
  30.   print('Bitcoin SELLPRICE: ${0}'.format(sellPrice))
  31.   print('Changerate:        ${0}'.format(changerate))
  32.   print('Daily Change:      ${0}'.format(change))
  33.   print('High:              ${0}'.format(high))
  34.   print('Low:               ${0}'.format(low))
  35.  
  36.  
  37. printit()
  38. #########################################
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement