On Feb 20, 6:54 am, Michael Herman <herma...@gmail.com> wrote:
> First - you can use Python in 
> Excel.http://www.python-excel.org/orhttps://www.datanitro.com/
>
> Updated code:
>
> import json
> import urllib
> import csv
>
> url = "http://bitcoincharts.com/t/markets.json";
> response = urllib.urlopen(url);
> data = json.loads(response.read())
>
> f = open("bitcoin.csv","wb")
> c = csv.writer(f)
>
> # write headers
> c.writerow(["Currency","Symbol","Bid", "Ask", "Volume"])
>
> for d in data:
>
> c.writerow([str(d["currency"]),str(d["symbol"]),str(d["bid"]),str(d["ask"]),str(d["currency_volume"])])



Looks neat.
Tried it with and without the str and there are small differences.

Why do you use the str?
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to