I’m attempting to create a function that will create a button named after a variable every time the submit to database function is used (1 button for every dataset submitted to my database). Currently I can get the button to name itself, but I’m having trouble offsetting the line for each time it’s used. I ..
I need to make the button save the path to its application. That is, I bind, say, a shortcut to a button, everything works, but if I restart, everything needs to be done again. Please tell me how to implement saving? my code: import tkinter.filedialog as tfd import tkinter as tk import os window = ..
I have this windoww : When i make a selection on one of my Listbox i lose my selection on my other listbox. But i need to concerve all my selections to get them all in my DB. I don’t have any difficult to get my datas in my DB but i can’t concerve my ..
I am making an audiobook and to listen to the text of an image I tried to use tesseract-OCR and it worked but when I will share my application with somebody else I don’t whether he has installed tesseract-OCR or not so I wanted that when my script starts it automatically installs the tesseract-OCR but ..
I have this function that launch an exe file def output(file, input_par): file = fd.askopenfile() var1 = ‘1n25n19n0.8n2n0.1n3n60n3’ p = Popen([file.name, ‘f’], stdout=PIPE, stdin=PIPE, stderr=PIPE, encoding="UTF8") lst = p.communicate(input=var1).splitlines() lst = list(dropwhile(lambda el: el.strip() != ‘MODEL DATA:’, lst)) return lst I have this button def openfile(): return filedialog.askopenfilename() button = ttk.Button(button_frame, text="Open", command=openfile) # <—— ..
Can anyone help me out delete one notebook tab and then reload it. I have this that destroy the tab but cant seem to reload it after. Why is it not reloading? from formularios import tabControlmain for item in tabControlmain.winfo_children(): if str(item) == (tabControlmain.select()): item.destroy() # this destroys tabmain1 return tabmain1 = ttk.Frame(tabControlmain)# creates tabmain1 ..
I want to add a text field and input text if the user choose "Yes" in the combo box; other wise nothing will be added. Tried this but didn’t work Combo = ttk.Combobox(window, values = vlist) Combo.set("Pick an Option") Combo.pack() if (Combo.get()=="Yes"): tkinter.Label(window, text="Number of Workers", bg = "white",fg = "black", font=("Times",13,"bold")).place(x=155,y=240) inputtxt3 = Text(window, ..
So, that’s one of the strangest errors I’ve ever seen in Python. Hopefully, you can help me. I have a tkinter mainwindow in main_file implementing images via: from PIL import Image, ImageTk, ImageColor #… self.image_package_render = Image.open(‘ImagePackage.png’) self.image_package_render_data = np.array(self.image_package_render.convert(‘RGBA’)) self.plus_render = ImageTk.PhotoImage(self.image_package_render.resize((14, 14), box=(16, 20, 30, 34))) When I launch the main_file directly, it ..
How do I force the button to change its text to the filename? Everything works fine, a dialog box opens and files open too. But I still can’t change the button name to the file name and save it. Here is the code: import tkinter.filedialog as tfd import tkinter as tk import os window = ..
I would like to define button color when disabled. Currently, I change the color of the button every time I change the button state. button.config(state=DISABLED, bg="grey") And then I need to change it back every time. Which is quite annoying. button.config(state=NORMAL, bg="red") There is an option for foreground disabledforeground so I expected there is a ..