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

Скачать или смотреть How to build your Python Application as an EXE (windows executable) file?

  • Programmer World
  • 2024-11-02
  • 424
How to build your Python Application as an EXE (windows executable) file?
  • ok logo

Скачать How to build your Python Application as an EXE (windows executable) file? бесплатно в качестве 4к (2к / 1080p)

У нас вы можете скачать бесплатно How to build your Python Application as an EXE (windows executable) file? или посмотреть видео с ютуба в максимальном доступном качестве.

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

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

Cкачать музыку How to build your Python Application as an EXE (windows executable) file? бесплатно в формате MP3:

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

Описание к видео How to build your Python Application as an EXE (windows executable) file?

In this video it shows the steps to create an EXE (windows executable) file for your Python Application. This EXE file can be used to be distributed to all the Windows OS users. They can run this as their desktop application.

For creating the EXE it uses the pyinstaller command. The complete command used is as follows:

pyinstaller --onefile --windowed .\SimpleCalculator.py

I hope you like this video. For any questions, suggestions or appreciation please contact us at: https://programmerworld.co/contact/ or email at: [email protected]

Details:
https://programmerworld.co/blogs/how-...


Code:

import tkinter as tk
from tkinter import messagebox

Create the main window
root = tk.Tk()
root.title("Simple Calculator")
root.geometry("500x500")

Global variable for storing the expression
expression = ""

Function to update the expression in the entry widget
def press(num):
global expression
expression += str(num)
equation.set(expression)

Function to evaluate the final expression
def equalpress():
try:
global expression
total = str(eval(expression))
equation.set(total)
expression = total
except:
equation.set("Error")
expression = ""

Function to clear the expression in the entry widget
def clear():
global expression
expression = ""
equation.set("")

Entry field for showing expression/result
equation = tk.StringVar()
expression_field = tk.Entry(root, textvariable=equation, font=("Arial", 20), bd=10, insertwidth=4, width=25, borderwidth=4)
expression_field.grid(row=0, column=0, columnspan=4)

Button layout
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),
]

Create buttons using a loop
for (text, row, col) in buttons:
if text == '=':
btn = tk.Button(root, text=text, height=3, width=8, font=("Arial", 18), command=equalpress)
elif text == 'C':
btn = tk.Button(root, text=text, height=3, width=8, font=("Arial", 18), command=clear)
else:
btn = tk.Button(root, text=text, height=3, width=8, font=("Arial", 18), command=lambda txt=text: press(txt))
btn.grid(row=row, column=col)

Start the GUI loop
root.mainloop()


--

Комментарии

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

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

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

video2dn Copyright © 2023 - 2025

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