In this article, we will learn how to create a Python script to read the latest news. We will fetch news from news API and after that, we will read news using pyttsx3.
Modules required :
pyttsx3 - pip install pyttsx3 requests - pip install requests
To get a API for news we will use newsapi.org. we will create account and take API key by clicking on get API button.
Step #1: Import modules needed
Step #2: Setting up URL with API key, place your API key here.
Step #3: Setting an engine for pyttsx3 for reading news.
Step #4: Setting up properties of our engine, means reading rate, volume, and sound of a voice.
Step #5: Trying to send request to get news. Here, engine.say() function is used to read news.
Now, everything is ready build a loop to read new articles.
Below is the complete Python implementation :
- Fetching top news using News API
- Python | Django News App
- Newspaper scraping using Python and News API
- Scrape most reviewed news and tweet using Python
- Python Desktop News Notifier in 20 lines
- Download and Install Python 3 Latest Version
- How to download and install Python Latest Version on macOS / Mac OS X
- How to download and install Python Latest Version on Windows
- How to download and install Python Latest Version on Android
- How to download and install Python Latest Version on Linux
- Python - Read blob object in python using wand library
- Python | os.read() method
- Read Only Properties in Python
- How to read from a file in Python
- Python | Read csv using pandas.read_csv()
- Read Modifiers in Wand Python
- Python program to read CSV without CSV module
- Read JSON file using Python
- Download and install pip Latest Version
- Read, Write and Parse JSON using Python
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to firstname.lastname@example.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.