How do I get the API to return the string in pt-br?
import wikipedia
pesquisa=wikipedia.summary(keyword)[0:150]
print(pesquisa)
How do I get the API to return the string in pt-br?
import wikipedia
pesquisa=wikipedia.summary(keyword)[0:150]
print(pesquisa)
If you are link set the language using:
wikipedia.set_lang("pt")
So:
import wikipedia
wikipedia.set_lang("pt") # Defina antes
pesquisa=wikipedia.summary(keyword)[0:150]
print(pesquisa)
See working at Repl.it
Note that Wikipedia only has pt
, does not have pt-BR
, ie wikipedia in Portuguese caters to Portugal and Brazil and probably other countries of the same language (of course I understand that there are variations, but within the articles themselves people try to adapt in the same texts)