Python@TW: 會眾| IRC| Planet| 郵件列表| 聯絡我們
修訂版 1 和 91 的差異如下: (間隔 90 版)
2007-02-22 00:43:35 修訂第 1 版
大小: 21
編輯者: yungyuc
說明:
2018-10-04 10:52:57 修訂第 91 版
大小: 313
編輯者: 59-124-9-153
說明:
這個顏色代表刪除的 這個顏色代表增加的
行號 1: 行號 1:
Python 是什麼? import json
from urllib.request import urlopen
url = "https://gdata.youtube.com/feeds/api/standardfeeds/top_rated?alt=json"
response = urlopen(url)
contents = response.read()
text = contents.decode('utf8')
data = json.loads(text)
for video in data['feed']['entry'][0:6]:
    print(video['tittle']['$t'])

import json from urllib.request import urlopen url = "https://gdata.youtube.com/feeds/api/standardfeeds/top_rated?alt=json" response = urlopen(url) contents = response.read() text = contents.decode('utf8') data = json.loads(text) for video in data['feed']['entry'][0:6]:

  • print(video['tittle']['$t'])

Python (上次是 59-124-9-153 在 2018-10-04 11:06:08 編輯的)