Coders Packet

Wikipedia search using wikipedia library in Python

By Rasika Deshpande

In this source code, Wikipedia search is done easily using wikipedia library in Python. Wikipedia search summary is displayed as output. Can be used in chatbots.

In this source code, Wikipedia search is done easily using wikipedia library in Python. Wikipedia search summary is displayed as output. What to search, input is taken from user. It can be used in chatbots. Good internet connection is a must for this code to work properly without any errors. Code can be more personalized by making minor changes as mention in the file.

 

Prerequisite:

Need internet connection to get the output.

 

Steps before running the code:

Install wikipedia library in your PC.

Run this command in command prompt - pip install wikipedia

 

How can you make the code personalized?

Right now the code prints first 4 sentences of the wikipedia summary. You can change the number of lines you want to print by changing the no_of_lines variable.

Download Complete Code

Comments

No comments yet