@lincanbin 帮我看下这个代码怎么写python
By
strwei
at 2017-04-10 • 0人收藏 • 1590人看过
一个api,我需要这些都打印出来,1分钟重新执行一次,写了半天不会
url:https://api.coinmarketcap.com/v1/ticker/zcoin/?convert=CNY
#!/usr/bin/env python # -*- coding:utf-8 -*- import requests,time,json,pygame,sys r=requests.get("https://api.coinmarketcap.com/v1/ticker/zcoin/?convert=CNY") r=json.loads(r.text) print r.json()['price_cny'].encode('utf-8') print '---'+time.strftime('%Y-%m-%d %H:%M:%S',time.localtime(time.time()))
登录后方可回帖