import wikipedia
wikipedia.summary("Tomato", sentences=3, auto_suggest=False)
输出是
'The tomato is the edible, often red, berry of the plant Solanum lycopersicum, commonly known as a tomato plant. The species originated in western South America and Central America. The Nahuatl (the language used by the Aztecs) word tomatl gave rise to the Spanish word tomate, from which the English word tomato derived.'
搜索
"Tomato"
会得到建议"tom tom"
。不知道为什么。。。在任何情况下,您都可以在wikipedia.summary
中禁用auto_suggest
:输出是
您可以看到,使用
wikipedia.search
函数搜索"Tomato"
表明"tom tom"
:{}是{},而{}是与番茄密切相关的标题列表
相关问题 更多 >
编程相关推荐