In this article we will see how we can create a PyQt5 application that tells about the details of coronavirus cases i.e total cases, recovered cases and total deaths only by typing the name of the country.
Modules required and Installation:
PyQt5 : PyQt is a Python binding of the cross-platform GUI toolkit Qt, implemented as a Python plug-in. PyQt is free software developed by the British firm Riverbank Computing.
Requests : Requests allows you to send HTTP/1.1 requests extremely easily. There’s no need to manually add query strings to your URLs.
Beautiful Soup: Beautiful Soup is a library that makes it easy to scrape information from web pages. It sits atop an HTML or XML parser, providing Pythonic idioms for iterating, searching, and modifying the parse tree.
Implementations steps :
1. Create a non-editable combo box, set its geometry
2. Create country list which contain countries name and add it to the combo box
3. Create three labels to show information about total cases, recovered cases and death cases
4. Set geometry, alignment and border to each label
5. Add action to the combo box
6. Inside the action get the country name and scrap the data from the website with the help of requests BeautifulSoup
7. Convert the raw data into html code and then filter it to get the required output
8. Show the output the screen with the help of labels
Below is the implementation
Attention geek! Strengthen your foundations with the Python Programming Foundation Course and learn the basics.
To begin with, your interview preparations Enhance your Data Structures concepts with the Python DS Course.
- Python - Details of CoronaVirus cases in various countries
- Corona Virus Live Updates for India - Using Python
- Corona Virus Details in India - Using Python PyQt5
- Plotting the Growth Curve of Coronavirus in various Countries using Python
- Python - Get Confirmed, Recovered, Deaths cases of Corona around the globe
- Get Corona cases details - Python PyQt5
- Python - Age Calculator using PyQt
- Designing GUI applications Using PyQt in Python
- PyQt Hello World
- PyQt – setVisible method for Label
- PyQt – Padding of Checkbox
- Python IMDbPY – Getting the countries of the series
- Python IMDbPY – Getting Series Countries as XML
- Corona HelpBot
- Python | Convert string list into multiple cases
- Useful cases to illustrate Decorators in python
- Python | Alternate cases in String
- Plotting Various Sounds on Graphs using Python and Matplotlib
- Access metadata of various audio and video file formats using Python - tinytag library
- Difference between various Implementations of 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 email@example.com. 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.