python赵璐版本课后答案_python第17章使⽤API课后习题答
案
import
requests
period函数import
pygal
php调用数据库from
pygal.style
python编程基础教程课后答案import LightColorizedStyle
as
LCS, LightenStyle
as
LS
# Make an API call, and store the response.
url
=
'api.github/search/repositories?q=language:javascr
ipt&sort=stars'
html5菜鸟r
=
requests
.
get(url)
gitee和githubprint
(
"Status code:"
, r
.
status_code)
# Store API response in a variable.
response_dictsession比cookie更安全吗
=
r
.
json()
print
(
"Total repositories:"
, response_dict[
'total_count'
])
# Explore information about the repositories.
repo_dicts
=
response_dict[
'items'
]
names, plot_dicts
=
[], []
for
repo_dict
in
repo_dicts:
names
.
append(repo_dict[
'name'
])
# When a project is removed, it's still listed with stars.
# So it's in the top projects, but has no description. The description
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系QQ:729038198,我们将在24小时内删除。
发表评论