Python@TW: 會眾| IRC| Planet| 郵件列表| 聯絡我們
修訂版 2 和 91 的差異如下: (間隔 89 版)
2007-02-23 00:52:12 修訂第 2 版
大小: 59
編輯者: Thinker
說明:
2018-10-04 10:52:57 修訂第 91 版
大小: 313
編輯者: 59-124-9-153
說明:
這個顏色代表刪除的 這個顏色代表增加的
行號 1: 行號 1:
Python 是什麼?
["Thinker"]: 我最愛用的語言!
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 編輯的)