Logo video2dn
  • Сохранить видео с ютуба
  • Категории
    • Музыка
    • Кино и Анимация
    • Автомобили
    • Животные
    • Спорт
    • Путешествия
    • Игры
    • Люди и Блоги
    • Юмор
    • Развлечения
    • Новости и Политика
    • Howto и Стиль
    • Diy своими руками
    • Образование
    • Наука и Технологии
    • Некоммерческие Организации
  • О сайте

Скачать или смотреть Free calculator with customtkinter (python)

  • Universe of PyBrawl
  • 2024-11-15
  • 73
Free calculator with customtkinter (python)
customtkinterpython
  • ok logo

Скачать Free calculator with customtkinter (python) бесплатно в качестве 4к (2к / 1080p)

У нас вы можете скачать бесплатно Free calculator with customtkinter (python) или посмотреть видео с ютуба в максимальном доступном качестве.

Для скачивания выберите вариант из формы ниже:

  • Информация по загрузке:

Cкачать музыку Free calculator with customtkinter (python) бесплатно в формате MP3:

Если иконки загрузки не отобразились, ПОЖАЛУЙСТА, НАЖМИТЕ ЗДЕСЬ или обновите страницу
Если у вас возникли трудности с загрузкой, пожалуйста, свяжитесь с нами по контактам, указанным в нижней части страницы.
Спасибо за использование сервиса video2dn.com

Описание к видео Free calculator with customtkinter (python)

code of calculator
1# first install customtkinter . bash : pip install customtkinter
2# code of the calculator . python :

import customtkinter as ctk

app = ctk.CTk()
app.geometry("300x400")
app.title("Calculator")

expression = ""

def add_symbol(symbol):
global expression
expression += str(symbol)
input_var.set(expression)

def clear():
global expression
expression = ""
input_var.set(expression)

def calculate():
global expression
try:
result = eval(expression)
input_var.set(result)
expression = str(result)
except Exception:
input_var.set("Error")
expression = ""

input_var = ctk.StringVar()
display = ctk.CTkEntry(app, textvariable=input_var, font=("Arial", 24), justify="right", width=250, height=50)
display.grid(row=0, column=0, columnspan=4, pady=10, padx=10)

buttons = [
("7", 1, 0), ("8", 1, 1), ("9", 1, 2), ("/", 1, 3),
("4", 2, 0), ("5", 2, 1), ("6", 2, 2), ("*", 2, 3),
("1", 3, 0), ("2", 3, 1), ("3", 3, 2), ("-", 3, 3),
("C", 4, 0), ("0", 4, 1), ("=", 4, 2), ("+", 4, 3),
]

for (text, row, col) in buttons:
if text == "=":
button = ctk.CTkButton(app, text=text, command=calculate, width=50, height=50)
elif text == "C":
button = ctk.CTkButton(app, text=text, command=clear, width=50, height=50)
else:
button = ctk.CTkButton(app, text=text, command=lambda t=text: add_symbol(t), width=50, height=50)
button.grid(row=row, column=col, padx=5, pady=5)

app.mainloop()

Комментарии

Информация по комментариям в разработке

Похожие видео

  • О нас
  • Контакты
  • Отказ от ответственности - Disclaimer
  • Условия использования сайта - TOS
  • Политика конфиденциальности

video2dn Copyright © 2023 - 2025

Контакты для правообладателей [email protected]