我是 python 新手......你被警告了。
我从http://wiki.python.org/moin/RssLibraries复制了一个示例,但我不断收到错误消息
"future_calls = [Future(feedparser.parse,rss_url) for rss_url in hit_list]
TypeError: __init__() takes exactly 1 argument (3 given)"
这是我的代码:
import feedparser
from futures import Future
hit_list = [ "http://feeds.reuters.com/news/artsculture", "http://feeds.reuters.com/reuters/healthNews" ] # list of feeds to pull down
# pull down all feeds
future_calls = [Future(feedparser.parse,rss_url) for rss_url in hit_list]
# block until they are all in
feeds = [future_obj() for future_obj in future_calls]
entries = []
for feed in feeds:
entries.extend( feed[ "item" ] )
sorted_entries = sorted(entries, key=lambda entry: entry["title"])
print sorted_entries