stock quotes off the web, py style
Brian Oney
brian.j.oney at googlemail.com
Wed May 16 12:07:07 EDT 2018
thank you for that tip. I missed that somehow...
На 16 май 2018 г. 16:31:37 GMT+02:00, Peter Otten <__peter__ at web.de> написа:
>Friedrich Rentsch wrote:
>
>> >>> ibm = urllib2.urlopen
>> ("https://api.iextrading.com/1.0/stock/IBM/quote").read()
>> >>> ibm = eval (ibm)
>
>Dont do this. You are allowing the guys at iextrading.com to execute
>arbitrary code on your machine. Use
>
> ibm = json.loads(ibm)
>
>instead or
>
> import urllib.request, json
> ibm = urllib.request.urlopen(
> "https://api.iextrading.com/1.0/stock/IBM/quote"
> ).read()
> ibm = json.loads(ibm.decode("utf-8"))
>
>if you are using Python 3.
>
>
>--
>https://mail.python.org/mailman/listinfo/python-list
More information about the Python-list
mailing list