Python—API项目
一个API项目
我是小杨我就这样
当一个代码的工匠回首往事,不因虚度年华而悔恨,也不因碌碌无为而羞愧,这样当他老去的时候,可以很自豪地告诉世人,我曾经将代码注入生命去打造互联网的浪潮之巅
公众号《小杨的技术人生》
展开
-
API项目——Hacker News网站上的热门文章
# coding: utf-8 import requests from operator import itemgetter # --------------------------------执行API调用并存储响应------------------------------------------------------------------ url = 'https://hacker...原创 2019-10-23 14:49:52 · 345 阅读 · 1 评论 -
API项目——数据绘图
# coding: utf-8 """根据数据自动生成plot_dicts""" import requests import pygal from pygal.style import LightColorizedStyle as LCS, LightenStyle as LS # -----------------执行API调用并存储响应--------------------------...原创 2019-10-21 17:29:10 · 281 阅读 · 0 评论 -
API项目——AttributeError: 'NoneType' object has no attribute 'decode'
运行如下代码时报错 # coding: utf-8 """根据数据自动生成plot_dicts""" import requests import pygal from pygal.style import LightColorizedStyle as LCS, LightenStyle as LS # -----------------执行API调用并存储响应----------------...原创 2019-10-21 17:27:57 · 803 阅读 · 0 评论 -
API项目——添加自定义提示
# coding: utf-8 """添加自定义工具提示: Pygal中,将鼠标向条形将显示她表示的信息——工具提示 给model add一个字典""" import pygal from pygal.style import LightColorizedStyle as LCS, LightenStyle as LS my_style = LS('#333366', base_s...原创 2019-10-21 17:05:24 · 232 阅读 · 1 评论 -
API项目——可视化
# coding: utf-8 import requests import pygal from pygal.style import LightColorizedStyle as LCS, LightenStyle as LS # -----------------执行API调用并存储响应-------------------------------------- URL = 'https...原创 2019-10-21 12:01:27 · 835 阅读 · 0 评论 -
API项目-1
# coding: utf-8 import requests # ----------------------------执行API调用并处理响应------------------------------- url = 'https://api.github.com/search/repositories?q=language:python&sort=stars' r = requ...原创 2019-10-21 11:59:13 · 237 阅读 · 0 评论