0

как импортировать python файл( в котором 3 окна tkinter)в .exe

я могу дать файлы от него: telegram: @L1meek Diskord: L1meek#6047

from tkinter import *
from re import T
import tkinter as tk
import tkinter.ttk as ttk
import time
from tkinter import *
tab1 = tk.Tk()
tab1.title("Loader")
tab1.geometry("185x25")

progress_bar = ttk.Progressbar(tab1, orient="horizontal",
                               mode="determinate", maximum=600, value=0)

label_1 = tk.Label(tab1, text="Load redactor:")

label_1.grid(row=0, column=0)
progress_bar.grid(row=0, column=2)

tab1.update()

progress_bar['value'] = 0
tab1.update()

while progress_bar['value'] < 600:
    progress_bar['value'] += 15

    tab1.update()
    time.sleep(0.1)
tab1.destroy()
import tkinter as tk
from tkinter.filedialog import askopenfilename, asksaveasfilename


def open_file():
    """Open File to read"""
    filepath = askopenfilename(
        filetypes=[("Text files", "*.txt"), ("All files", "*.*")]
    )
    if not filepath:
        return
    txt_edit.delete("1.0", tk.END)
    with open(filepath, "r") as input_file:
        text = input_file.read()
        txt_edit.insert(tk.END, text)
    tab1.title(f"Txt redactor - {filepath}")


def save_file():
    """Save this file."""
    filepath = asksaveasfilename(
        defaultextension="txt",
        filetypes=[("Text files", "*.txt"), ("All files", "*.*")],
    )
    if not filepath:
        return
    with open(filepath, "w") as output_file:
        text = txt_edit.get("1.0", tk.END)
        output_file.write(text)
    tab1.title(f"Txt redaktor - {filepath}")


tab1 = tk.Tk()
tab1.title("Txt reader")
tab1.rowconfigure(0, minsize=800, weight=1)
tab1.columnconfigure(1, minsize=800, weight=1)

txt_edit = tk.Text(tab1)
txt_edit["font"] = 'Times'

fr_buttons = tk.Frame(tab1, relief=tk.RAISED, bd=2)
btn_open = tk.Button(fr_buttons, text="Открыть", command=open_file)
btn_save = tk.Button(fr_buttons, text="Сохранить как...", command=save_file)

btn_open.grid(row=0, column=0, sticky="ew", padx=5, pady=5)
btn_save.grid(row=9, column=0, sticky="ew", padx=5)

fr_buttons.grid(row=0, column=0, sticky="ns")
txt_edit.grid(row=0, column=1, sticky="nsew")


def callback(event):
    tab1.title("Txt reader - Тёмная тема")
    txt_edit['bg'] = "Black"
    txt_edit['fg'] = '#ffffff'
    txt_edit["font"] = 'Codename'


def callback2(event):
    tab1.title("Txt reader")
    txt_edit['bg'] = "#ffffff"
    txt_edit['fg'] = 'black'
    txt_edit["font"] = 'Times'


def callback3(event):
    tab1.title("Txt reader - Крастная тема")
    txt_edit['bg'] = "Red"
    txt_edit['fg'] = 'black'
    txt_edit["font"] = 'Codename'


def callback4(event):
    tab1.title("Txt reader - Хакер тема")
    txt_edit['bg'] = "Black"
    txt_edit['fg'] = 'lime'
    txt_edit["font"] = 'Comic Sans MS'


abc = 1
size = abc


def size1(event):
    txt_edit.configure(font=size + 1)
    abc = abc + 1


tab1.bind('<Control-p>', size1)
tab1.bind('<Control-b>', callback)
tab1.bind('<Control-l>', callback2)
tab1.bind('<Control-r>', callback3)
tab1.bind('<Control-h>', callback4)


def lol2():
    vvz = Tk()
    tet = Text(vvz, width=50, height=10, bg="black", fg="white")
    tet.pack()
    tet.insert(1.0,
               '!Перед использованием\n биндов, убедитесь что\n вы включили Eng раскладку!\nТемы:''\n    Ctrl+b = Тёмная тема'   '\n    Ctrl+l = Класическая тема\n    Ctrl+r = Красная тема')
    tet.pack()
    vvz.mainloop()


btn = tk.Button(tab1, text="Binds")
btn.config(command=lol2)
btn.place(x=5, y=750)


our_image = PhotoImage(file="pen.png")
our_image = our_image.subsample(10, 10)
our_label = Label(tab1)
our_label.image = our_image
our_label['image'] = our_label.image
our_label.place(x=10, y=700)


from playsound import playsound
playsound("sound1.wav")


tab1.mainloop()
3
  • Пиши код прямо в вопросе!
    – ΝNL993
    6 мар 2022 в 17:29
  • Пожалуйста, уточните вашу конкретную проблему или приведите более подробную информацию о том, что именно вам нужно. В текущем виде сложно понять, что именно вы спрашиваете. 6 мар 2022 в 17:33
  • Он не помещается
    – L1meek
    6 мар 2022 в 17:33

0

Ваш ответ

By clicking “Отправить ответ”, you agree to our terms of service and acknowledge you have read our privacy policy.

Посмотрите другие вопросы с метками или задайте свой вопрос.