1import wikipedia
2print wikipedia.summary("Wikipedia")
3# Wikipedia (/ˌwɪkɨˈpiːdiə/ or /ˌwɪkiˈpiːdiə/ WIK-i-PEE-dee-ə) is a collaboratively edited, multilingual, free Internet encyclopedia supported by the non-profit Wikimedia Foundation...
4
5wikipedia.search("Barack")
6# [u'Barak (given name)', u'Barack Obama', u'Barack (brandy)', u'Presidency of Barack Obama', u'Family of Barack Obama', u'First inauguration of Barack Obama', u'Barack Obama presidential campaign, 2008', u'Barack Obama, Sr.', u'Barack Obama citizenship conspiracy theories', u'Presidential transition of Barack Obama']
7
8ny = wikipedia.page("New York")
9ny.title
10# u'New York'
11ny.url
12# u'http://en.wikipedia.org/wiki/New_York'
13ny.content
14# u'New York is a state in the Northeastern region of the United States. New York is the 27th-most exten'...
15ny.links[0]
16# u'1790 United States Census'
17
18wikipedia.set_lang("fr")
19wikipedia.summary("Facebook", sentences=1)
20# Facebook est un service de réseautage social en ligne sur Internet permettant d'y publier des informations (photographies, liens, textes, etc.) en contrôlant leur visibilité par différentes catégories de personnes.
21
1#pip install wikipedia
2import wikipedia
3question = input("What is your question? ")
4print(wikipedia.summary(question))