Skip to content

Commit 1efe496

Browse files
ADDING new .py
1 parent fc2ef87 commit 1efe496

File tree

3 files changed

+21
-0
lines changed

3 files changed

+21
-0
lines changed

wikipedia/lang.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
import wikipedia
2+
wikipedia.set_lang("fr")
3+
print(wikipedia.summary("Facebook", sentences=1))
4+
5+
# output :
6+
# 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.

wikipedia/wiki2.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
import wikipedia
2+
print(wikipedia.search("Barack"))
3+
4+
# output :
5+
#[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']

wikipedia/wiki3.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
import wikipedia
2+
ny = wikipedia.page("New York")
3+
print(ny.title)
4+
print(ny.url)
5+
print(ny.content)
6+
print(ny.links[0])
7+
# output : u'New York'
8+
# u'http://en.wikipedia.org/wiki/New_York'
9+
# u'New York is a state in the Northeastern region of the United States. New York is the 27th-most exten'...
10+
# u'1790 United States Census'

0 commit comments

Comments
 (0)