Professional Documents
Culture Documents
Comp Project
Comp Project
Comp Project
This application not only provides insightful health information but also ensures
data integrity by securely storing your input, results, and personal details in a
MySQL database. It's a handy tool for individuals of all ages, offering a
personalized experience by letting you input your name, weight, height, age,
gender, and activity level. Get ready to embark on your fitness journey with
"Muscle Flex," where health insights and convenience converge to assist you in
achieving your wellness goals.
PROPOSED SYSTEM
HISTORY OF PYTHON
One of Python's defining attributes is its vibrant and devoted community, which
assumes a pivotal role in molding the language's trajectory and prosperity.
Python stands as an open-source language, and its community actively
contributes to the advancement of countless libraries and frameworks,
broadening Python's applicability across an extensive spectrum of domains.
This cooperative approach gives rise to a diverse ecosystem of tools and
resources, rendering Python an invaluable asset in numerous industries.
Enduringly popular, Python perpetually adapts and evolves, maintaining its
place at the vanguard of technological progress. Its legacy transcends mere
programming—it stands as a testament to the timeless allure of simplicity,
clarity, and a collaborative development model. Python's history and future are
inexorably intertwined, and as it propels forward, it continues to serve as an
indispensable instrument in the realm of software development and
technological innovation.
HISTORY OF MYSQL
The choice of MySQL as the database management system for your app is a
strategic decision rooted in a multitude of advantages and features that have
solidified MySQL's position as a favored database solution for diverse
applications. First and foremost, MySQL is celebrated for its opensource nature,
which significantly reduces the financial barriers to entry for developers and
organizations. Its open-source status means that it can be freely used and
redistributed, making it particularly appealing for startups, small businesses, and
projects with budget constraints. Moreover, MySQL is renowned for its
scalability. This feature makes it an excellent fit for applications with
anticipated growth and surges in user engagement. MySQL can effectively
handle vast amounts of data and traffic, ensuring your app's performance and
responsiveness remain steady even as the user base expands. Security is another
compelling reason for the selection of MySQL for your app. The database
system incorporates a variety of security features, including authentication
mechanisms, encryption options, and access control mechanisms. These
security layers provide peace of mind for both developers and users, ensuring
the confidentiality and integrity of sensitive data. MySQL's active and thriving
community is an invaluable resource for developers. The vast amount of
documentation, tutorials, forums, and community contributed knowledge makes
it a well-supported platform. In addition, numerous companies and experts offer
professional support services, ensuring that assistance is readily available when
needed. Data management features, such as a wide range of data types and
efficient indexing options, facilitate optimized storage and retrieval of
information. These capabilities are beneficial for applications like your notes
app, which depend on the efficient organization and retrieval of data. MySQL's
support for replication and high availability is essential for applications that
require backup servers and failover mechanisms to ensure continuous operation,
even in the event of hardware or network failures. Furthermore, MySQL
benefits from a rich ecosystem of community extensions, plugins, and
connectors. These components extend and enhance its functionality, making it
versatile for a broad range of use cases. The seamless integration possibilities
that MySQL offers are essential for apps that need to connect to various
components and systems, such as web servers, application servers, and external
data sources. MySQL's compatibility with numerous technologies and
frameworks makes it a versatile and adaptable choice. In conclusion, the
selection of MySQL for your app is a well-considered choice, aligning with its
reputation for reliability, performance, and cost-efficiency. The features and
benefits of MySQL ensure that it serves as a dependable foundation for various
applications, including your notes app, which demands efficient data
management and seamless integration capabilities.
SOURCE CODE & OUTPUT
from pathlib import Path
import tkinter as tk
import mysql.connector
import sys
icon_path=(r"F:\Pendrive
school\projects\muscle_flex\build\Required\muscleflex.ico")
asset_path=(r"F:\Pendrive school\projects\muscle_flex\build\Required")
cursor = conn.cursor()
cursor.execute("CREATE DATABASE IF NOT EXISTS test")
def start():
def calculate_bmi_tdee():
# Get values from entry fields
name = entry_1.get()
weight = float(entry_2.get())
height = float(entry_3.get())
age = int(entry_5.get())
gender = (entry_4.get())
# Calculate BMI
height_m = height / 100 # Convert height from cm to m
weight_status = "underweight"
elif bmi < 25:
else:
weight_status = "obese"
if gender.upper() == "Male":
bmr = 10 * weight + 6.25 * height - 5 * age + 5
elif gender.upper() == "female":
bmr = 10 * weight + 6.25 * height - 5 * age - 161
else:
activity_level = entry_6.get()
if activity_level.lower() == "sedentary":
else:
print("error")
cursor = conn.cursor()
cursor.execute("CREATE TABLE IF NOT EXISTS data (id INT
AUTO_INCREMENT PRIMARY KEY, name VARCHAR(255), weight int,
height int, age int, gender varchar(10), bmi float, weight_status varchar(225),
tdee int)")
# Insert the data into the database
sql = "INSERT INTO data (name, weight, height, age, gender, bmi,
weight_status, tdee) VALUES (%s, %s, %s, %s, %s, %s, %s, %s)"
cursor.execute(sql, val)
result_window =ctk.CTk()
result_window.geometry("400x100")
result_window.title("Muscle Flex")
result_window.iconbitmap(icon_path)
result_window.configure(bg = "#242424")
bmi_result_ctk= ctk.CTkLabel(master=result_window,
text=bmi_result_label)
bmi_result_ctk= ctk.CTkLabel(master=result_window,
text=tdee_result_label )
result_window.mainloop()
OUTPUT_PATH = Path(__file__).parent
ASSETS_PATH = OUTPUT_PATH / Path(asset_path)
sec_window.title("Muscle Flex")
sec_window.iconbitmap(icon_path)
sec_window.geometry("700x500")
sec_window.configure(bg="#242424")
canvas = Canvas(
window,
bg = "#242424",
height = 500,
width = 700,
bd = 0,
highlightthickness = 0,
relief = "ridge"
)
canvas.place(x = 0, y = 0)
canvas.create_rectangle(
0.0,
0.0,
202.0,
500.0,
fill="#181818",
outline="")
button_image_1 = PhotoImage(
file=relative_to_assets("button_1.png"))
button_1 = Button(
image=button_image_1,
borderwidth=0,
highlightthickness=0,
)
button_1.place(
x=7.0,
y=35.0,
width=188.0,
height=42.0
canvas.create_text(
338.0,
12.0,
anchor="nw",
text="CALORIE CALCULATOR",
fill="#FFFFFF",
font=("RobotoRoman ExtraLight", 20 * -1)
button_image_2 = PhotoImage(
file=relative_to_assets("button_2.png"))
button_2 = Button(
image=button_image_2,
borderwidth=0,
highlightthickness=0,
command=calculate_bmi_tdee,
relief="flat"
)
button_2.place(
x=362.0,
y=440.0,
width=179.0,
height=32.0
)
entry_image_1 = PhotoImage(
file=relative_to_assets("entry_1.png"))
entry_bg_1 = canvas.create_image(
451.5,
88.5,
image=entry_image_1
)
entry_1 = Entry(
bd=0,
bg="#5D5D5D",
fg="#000716",
highlightthickness=0
)
entry_1.place(
x=237.0,
y=69.0,
width=429.0,
height=37.0
)
canvas.create_text(
233.0,
56.0,
anchor="nw",
text="Enter your name",
fill="#FFFFFF",
font=("RobotoRoman ExtraLight", 10 * -1)
entry_image_2 = PhotoImage(
file=relative_to_assets("entry_2.png"))
entry_bg_2 = canvas.create_image(
451.5,
268.5,
image=entry_image_2
)
entry_2 = Entry(
bd=0,
bg="#5D5D5D",
fg="#000716",
highlightthickness=0
entry_2.place(
x=237.0,
y=249.0,
width=429.0,
height=37.0
)
canvas.create_text(
233.0,
236.0,
anchor="nw",
text="Weight (kg)",
fill="#FFFFFF",
entry_image_3 = PhotoImage(
file=relative_to_assets("entry_3.png"))
entry_bg_3 = canvas.create_image(
451.5,
208.5,
image=entry_image_3
)
entry_3 = Entry(
bd=0,
bg="#5D5D5D",
fg="#000716",
highlightthickness=0
entry_3.place(
x=237.0,
y=189.0,
width=429.0,
height=37.0
)
canvas.create_text(
233.0,
294.0,
anchor="nw",
text="Gender",
fill="#FFFFFF",
)
canvas.create_text(
233.0,
352.0,
anchor="nw",
text="Activity Level",
fill="#FFFFFF",
font=("RobotoRoman ExtraLight", 10 * -1)
)
entry_image_4 = PhotoImage(
file=relative_to_assets("entry_4.png"))
entry_bg_4 = canvas.create_image(
451.5,
328.5,
image=entry_image_4
)
entry_4 = Entry(
bd=0,
bg="#5D5D5D",
fg="#000716",
highlightthickness=0
)
entry_4.place(
x=237.0,
y=309.0,
width=429.0,
height=37.0
)
canvas.create_text(
233.0,
176.0,
anchor="nw",
text="Height (cm)",
fill="#FFFFFF",
entry_image_5 = PhotoImage(
file=relative_to_assets("entry_5.png"))
entry_bg_5 = canvas.create_image(
451.5,
148.5,
image=entry_image_5
)
entry_5 = Entry(
bd=0,
bg="#5D5D5D",
fg="#000716",
highlightthickness=0
entry_5.place(
x=237.0,
y=129.0,
width=429.0,
height=37.0
)
canvas.create_text(
233.0,
116.0,
anchor="nw",
fill="#FFFFFF",
)
canvas.create_text(
375.0,
406.0,
anchor="nw",
text="*Sedentary/Lightly active/Moderately active/Very active/Super
active*",
fill="#FFFFFF",
)
entry_image_6 = PhotoImage(
file=relative_to_assets("entry_6.png"))
entry_bg_6 = canvas.create_image(
451.5,
386.5,
image=entry_image_6
)
entry_6 = Entry(
bd=0,
bg="#5D5D5D",
fg="#000716",
highlightthickness=0
)
entry_6.place(
x=237.0,
y=367.0,
width=429.0,
height=37.0
)
window.resizable(False, False)
window.mainloop()
OUTPUT_PATH = Path(__file__).parent
ASSETS_PATH = OUTPUT_PATH / Path(asset_path)
window.geometry("700x500")
window.title("Muscle Flex")
window.iconbitmap(icon_path)
window.configure(bg = "#FFFFFF")
canvas = Canvas(
window,
bg = "#FFFFFF",
height = 500,
width = 700,
bd = 0,
highlightthickness = 0,
relief = "ridge"
)
canvas.place(x = 0, y = 0)
image_image_1 = PhotoImage(
file=relative_to_assets("image_1.png"))
image_1 = canvas.create_image(
200.0,
250.0,
image=image_image_1
canvas.create_rectangle(
400.0,
0.0,
700.0,
500.0,
fill="#242424",
outline="")
button_image_1 = PhotoImage(
file=relative_to_assets("button_0.png"))
button_1 = Button(
image=button_image_1,
borderwidth=0,
highlightthickness=0,
command=start,
relief="flat"
button_1.place(
x=419.0,
y=350.0,
width=262.0,
height=44.0
)
image_image_2 = PhotoImage(
file=relative_to_assets("image_2.png"))
image_2 = canvas.create_image(
338.0,
53.0,
image=image_image_2
)
window.resizable(False, False)
window.mainloop()
7
Hardware Requirements:
Software Requirements: