BMI Calculator Python Program with Source Code

This BMI Calculator Python is created using tkinter and graphical user interface. The BMI Calculator in Python is free to download the open source code.

The task is for the client advantageous, for measure your body fat or body mass index (BMI). With the BMI esteem, you can check whether you have a solid weight or not. The undertaking record contains a python content (BMI.py).

BMI Calculator Program in Python – Project Information’s

Project Name:Python BMI Calculator
Language/s Used:Python Programming Language (GUI) Based
Python version (Recommended):2.x or 3.x
Database:None
Type:Python App
Developer:IT SOURCECODE
Updates:0
BMI Calculator Program in Python – Project Information

Discussing the highlights of this Python BMI Calculator framework, this python application is intended to figure the BMI weight, height estimation of client by entering the estimation of their height and weight.

You can simply need to choose the weight and enter the stature you need to include in estimations and snap the catch for the outcome. It is fit for dealing with a wide range of exemptions.

Before you start creating this  BMI Calculator Python, make sure that you have PyCharm IDE installed in your computer.

Steps on How To Create a BMI Calculator Program in Python with Source Code

Time needed: 5 minutes

These are the steps on How To Create a BMI Calculator in Python with Source Code

  1. Step 1: Create a project name.

    First when you finished installed the Pycharm IDE in your computer, open it and then create a “project name” after creating a project name click the “create” button.Creating Project Name in BMI Calculator in Python with Source Code

  2. Step 2: Create a python file.

    Second after creating a project name, “right click” your project name and then click “new” after that click the “python file“.Creating Python File Name in BMI Calculator in Python with Source Code

  3. Step 3: Name your python file.

    Third after creating a python file, Name your python file after that click “enter“.Namin Python File Name in BMI Calculator in Python with Source Code

  4. Step 4: The actual code.

    This is the actual coding on how to create BMI Calculator in Python, and you are free to copy this code and download the full source code given below.

Code Explanations

1. Importing Tkinter Module

Code:

from tkinter import *

Explanation:

In the code given below, which is for the function for importing tkinter. Tkinter is the standard GUI library for Python. Python when combined with Tkinter provides a fast and easy way to create GUI applications.

2. This module is for the BMI calculator

Code:

def BodyMassIndex_Calculator():
BMI_Height = float(variable2.get())
BMI_Weight = float(variable1.get())
BodyMassIndex = str('%.2f' % (BMI_Weight / (BMI_Height * BMI_Height)))
lbl_res_bmi.config(text=BodyMassIndex)

Explanation:

In the code given below, which is for the function for BMI calculator.

3. This module is for the design for main window

Code:

Tops = Frame(application, width=1350, height=50, bd=8, relief="raise")
Tops.pack(side=TOP)

frame1 = Frame(application, width=600, height=600, bd=8, relief="raise")
frame1.pack(side=LEFT)

frame2 = Frame(application, width=300, height=700, bd=8, relief="raise")
frame2.pack(side=RIGHT)

frame1A = Frame(frame1, width=600, height=200, bd=20, relief="raise")
frame1A.pack(side=TOP)
frame1B = Frame(frame1, width=600, height=600, bd=20, relief='raise')
frame1B.pack(side=TOP)

lbl_T1 = Label(Tops, text=" BODY MASS INDEX ", padx=16, pady=16, bd=16, fg='#000000',
font=("arial", 54, 'bold'), bg="navajo white", relief='raise', width=32, height=1)
lbl_T1.pack()

lbl_w = Label(frame1A, text="Select Weight in Kilograms", font=('arial', 20, 'bold'), bd=20).grid(row=0, column=0)
b_w = Scale(frame1A, variable=variable1, from_=1, to=500, length=880, tickinterval=30, orient=HORIZONTAL)
b_w.grid(row=1, column=0)

lbl_h = Label(frame1B, text="Enter Height in Meters Square", font=('arial', 20, 'bold'), bd=20).grid(row=0, column=0)
t_h = Entry(frame1B, textvariable=variable2, font=('arial', 16, 'bold'), bd=16, width=22, justify='center')
t_h.grid(row=1, column=0)

lbl_res_bmi = Label(frame1B, padx=16, pady=16, bd=16, fg='#000000', font=('arial', 30, 'bold'), bg='navajo white',
relief='sunk', width=34, height=1)
lbl_res_bmi.grid(row=2, column=0)

Explanation:

In the code given below, which is for the function for the design of BMI screen windows. You can see the frame, and the label use in the system.

4. This module is the design for BMI table

Code:

lbl_table_bmi = Label(frame2, font=("arial", 20, 'bold'), text='BMI Table').grid(row=0, column=0)
bmi_tab_text_lbl = Text(frame2, height=12, width=38, bd=16, font=("arial", 12, 'bold'))
bmi_tab_text_lbl.grid(row=1, column=0)

bmi_tab_text_lbl.insert(END, 'Meaning \t\t' + "BMI \n\n")
bmi_tab_text_lbl.insert(END, 'Normal weight \t\t' + "19-24 \n\n")
bmi_tab_text_lbl.insert(END, 'Overwight \t\t' + "25-29,9 \n\n")
bmi_tab_text_lbl.insert(END, 'Obesity level I \t\t' + "30-34, 9 \n\n")
bmi_tab_text_lbl.insert(END, 'Obesity level II \t\t' + "35-39, 9\n\n")
bmi_tab_text_lbl.insert(END, 'Obesity level III \t\t' + ">= 40\n\n")

Explanation:

In the code given below, which is for the function for the design of BMI table.

Downloadable Source Code Below

I have here the list of Best Python Project with Source code free to download for free, I hope this can help you a lot.

Summary

That’s how you create BMI Calculator in Python in your projects. You can always expand and try different ways in implementing the BMI Calculator in Python in your Python projects. 

Inquiries

If you have any questions or suggestions about BMI Calculator Python Program with Source Code , please feel free to leave a comment below.

Technology stack and requirements

To run this Python project on your development machine, you need:

  • Python 3.10 or higher. Download from python.org or install via Anaconda if you prefer bundled packages.
  • pip package manager. Comes with Python. Used to install project dependencies from requirements.txt.
  • Virtual environment. Use venv or conda to isolate project dependencies from your global Python install.
  • VS Code or PyCharm. Free code editors with Python syntax highlighting, IntelliSense, and debugging.
  • Git. For version control and cloning source code repositories.

Installing the source code

  1. Download or clone the repository. Get the ZIP archive from the download link on this page and extract it.
  2. Create a virtual environment. Open a terminal in the project folder and run: python -m venv venv, then activate it (venv\Scripts\activate on Windows or source venv/bin/activate on Mac/Linux).
  3. Install dependencies. Run pip install -r requirements.txt to install all libraries the project needs.
  4. Configure environment variables. If the project uses API keys (OpenAI, Anthropic, database), create a .env file and set the required keys.
  5. Run the project. Follow the run command in the README (usually python main.py or streamlit run app.py).

Using this project for your BSIT capstone

  • Chapter 1 (Introduction). Discuss the real-world problem this system solves. Cite Philippine or international use cases where the manual process could be automated.
  • Chapter 2 (RRL). Compare your project against 5-10 similar published works. Cite ACM, IEEE, or arXiv papers for academic-standard sources.
  • Chapter 3 (Methodology). Document the model architecture, training data, hyperparameters, and evaluation metrics used.
  • Chapter 4 (Results). Report accuracy, precision, recall, F1-score, and confusion matrix. Screenshot the running app on real inputs.
  • Chapter 5 (Conclusion). Identify features for Version 2: better model, larger dataset, mobile deployment, or REST API.

Modules typical of BMI Calculator Python Program

  • Core Python logic. Main functions implementing the business logic of the system.
  • Data storage. SQLite for simple projects, PostgreSQL or MongoDB for larger data.
  • User interface. Tkinter for desktop, Streamlit for data dashboards, or Flask/FastAPI for web.
  • Input validation. Type checking and range validation before processing user data.
  • Reports. CSV or PDF export using pandas.to_csv() or ReportLab.
  • Testing. pytest unit tests covering core functions.

Common enhancements for capstone review

  • Add REST API. Convert desktop app to FastAPI service for mobile or web front-ends.
  • Multi-user support. Add login, roles, and per-user data isolation.
  • Cloud deployment. Deploy to Render, Railway, or Fly.io for public access.
  • Docker containerization. Package the app in Docker for portable deployment.

Frequently Asked Questions

How does this Python calculator project work?

Built with Tkinter Frame + Entry widget + Button grid. Each digit/operator button appends to display. = button uses eval() (simple) or proper expression parser (safer). Foundation for any GUI Python beginner project.

What Python version and libraries does this project require?

Most projects in this batch use Python 3.10, 3.11, or 3.12 (avoid 3.13 until library wheels catch up). Standard libs: tkinter (built-in), sqlite3 (built-in). External: pip install pillow opencv-python pygame mysql-connector-python reportlab requests beautifulsoup4. Check the requirements.txt file (if included) for exact versions.

How do I set up the database for this Python project?

For SQLite (most common, no setup needed): the .db file auto-creates on first run. For MySQL: install MySQL Server + MySQL Workbench, create an empty database, import the included .sql file, edit the connection string in db.py (or db_connect.py) with your host, user, password, database name.

Can I use this Python project for a BSIT capstone or thesis?

Yes. Python is rising fast in Philippine BSIT panels. Extend it: add user roles via auth module, dashboards (matplotlib charts), PDF reports (reportlab), email notifications (smtplib), real domain extension (analytics, audit log, multi-branch support). Pair with Chapter 1-5 documentation matching your panel’s rubric.

Why am I getting ‘ModuleNotFoundError’ or ‘No module named X’?

Three common Python issues: (1) Module not installed: pip install (use pip3 on macOS/Linux). (2) Wrong virtualenv: activate the project’s venv before running (python -m venv venv then venv\Scripts\activate on Windows or source venv/bin/activate on Linux/macOS). (3) Python 2 vs Python 3 mismatch: ensure you run python3 main.py not python main.py if both are installed.

Where can I find more Python projects with source code?

Browse the Python Projects hub for the full library. For computer vision specifically see OpenCV Projects (46 vision systems). For ML / AI capstones see Machine Learning Projects. For BSIT capstone idea lists see 150 Best Capstone Project Ideas.

Adones Evangelista


Programmer & Technical Writer at PIES IT Solution

Adones Evangelista is a programmer and writer at PIES IT Solution, author of over 900 tutorials and error-fix guides at itsourcecode.com. Specializes in JavaScript, Django, Laravel, and Python error debugging covering ValueError, TypeError, AttributeError, ModuleNotFoundError, and RuntimeError, plus C/C++ and PHP capstone projects for BSIT students.

Expertise: JavaScript · Python · Django · Laravel · Error Debugging · C/C++
 · View all posts by Adones Evangelista →

Leave a Comment