I have a project done and it is in the following
import tkinter as tk
from tkinter import ttk
import tkinter.messagebox as tmb
from ttkthemes import ThemedStyle
class UI(ttk.Frame):
def __init__(self, parent=None):
super(UI, self).__init__(parent)
self.parent = parent
style = ThemedStyle(parent)
style.set_theme("arc")
self.parent.geometry("480x520")
self.init_ui()
def init_ui(self):
self.parent.title("Nueva ventana heredada")
self.entrada = ttk.Entry(self, text="ingresa")
self.entrada.grid(row=2, column=2)
boton = ttk.Button(self, text="pulsame", command=self.ver)
boton.grid(row=2, column=3)
self.pack()
def ver(self):
try:
res = int(self.entrada.get())
print(res)
except ValueError:
tmb.showwarning(title = "error", message = " error")
if __name__== '__main__':
root = tk.Tk()
sug = tk.Label(root, text="aqui es para escribir")
sug.pack()
app = UI(parent=root)
app.mainloop()
When I use pyinstaller to create an exe, it releases the error that the exported exe program can not be executed: below I leave it as I use it, it should be noted that I have used a thema for the program and I doubt that it is imported.
pyinstaller --windowed ui.py -i icono.ico --onefile
error
Fatal Error! Failed to execute script ui
to similar url https://es.stackoverflow.com/questions/118595/como-hacer-que-pyinstaller-importe-el-ttktheme