Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 1 of 1
Thread: Python Error with Bitcoin
04-12-2014, 01:05 AM #1
- Join Date
- Apr 2014
- Thanked 0 Times in 0 Posts
Python Error with Bitcoin
I'm trying to replicate what was done in this video: https://www.youtube.com/watch?v=cWf-WXaLFJ8
I think he is using a different version of python though because I'm getting errors. I have python 3.4
This is what I have so far:
import time import json import urllib.request def main(): btcePrices = urllib.request.urlopen('https://btc-e.com/api/2/btc_usd/ticker') btcejson = json.loads(btcePrices) btcelastP = btcejson['ticker']['last'] btcelastT = btcejson['ticker']['updated'] print (btcelastP) while True: main() time.sleep(1)
anyone know how to fix this?