In this article we will see how we can create a heart beats and breaths calculator using PyQt5. Below is how the calculator will look like.
A normal resting heart rate for adults ranges from 60 to 100 beats per minute. Generally, a lower heart rate at rest implies more efficient heart function and better cardiovascular fitness. For example, a well-trained athlete might have a normal resting heart rate closer to 40 beats per minute.
Respiratory rate: A person’s respiratory rate is the number of breaths you take per minute. The normal respiration rate for an adult at rest is 12 to 20 breaths per minute. A respiration rate under 12 or over 25 breaths per minute while resting is considered abnormal.
GUI Implementation Steps :
1. Create a heading label that display the calculator name
2. Create label to show user to select the birth date and the birth time
3. Create a QCalendarWidget object for user to select the birth date
4. Create a QTimeEdit object to get the birth time
5. Create a push button to calculate the heart beats and breaths
6. Create a label to show the calculated beats and breaths
Back-End Implementation :
1. Make the calendar future date block i.e set current date as maximum date
2. Add action to the push button
3. Inside the push button action get the date from the calendar and time from the QTimeEdit
4. Get the day, month and year from the date and hour and minute from the time edit
5. Create a datetime object for current date and the birth date
6. Get the difference from both the dates and get the days and seconds
7. Convert days and seconds into minutes
8. Get the heart beats and breaths by multiplying minutes with the average rates.
9. Show the calculated beats and breaths with the help of label
Below is the implementation
- Ratio Calculator using PyQt5
- PyQt5 - Percentile Calculator
- PyQt5 - Flames Calculator
- Dog Years Calculator using PyQt5
- Aspect Ratio Calculator using PyQt5
- PyQt5 - Average Speed Calculator
- PyQt5 - Age Nearest Birthday Calculator
- Silver Ratio Calculator using PyQt5
- 1/4 Mile Calculator using PyQt5 in Python
- Loan Calculator using PyQt5 in Python
- PyQt5 - Days From Date Calculator
- Building Calculator using PyQt5 in Python
- Creating Golden Ratio Calculator using PyQt5
- PyQt5 - Calculator for Number of seconds You have Lived
- Smart calculator in Python
- Vegan Calculator using Python
- Python: Age Calculator using Tkinter
- Python - Age Calculator using PyQt
- How to make calculator using kivy | Python
- Basic calculator program 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.