So, in the code below, I’m attempting to ensure that when I press a button that says "Select File", a window pops up that lets you choose a folder/file to save some information in that will be stored into the program later. The code is below: def selectFile(): file = filedialog.askopenfile(defaultextension=’.*’, filetypes=[ ("Text file", ".txt"), ..
I am making UI for the ML project using flask. Basically, I need to load the local audio from pc and predict. I have done that. But I can’t play the same audio on the web and pass the file through the flask to the audio tag of the HTML page. @app.route("/", methods=["GET", "POST"]) def ..
I am trying to convert my python program to exe using pyinstaller My files name is main.py I want no console, so i used -w flag, but it is not working. I am using the command pyinstaller –onefile -w main.py It gives me 3 folders and one .spec file as in the attached picture. Among ..
I have designed a GUI using Pyhton Tkinter. However using geometry managers and after resizing the images, it appears different in different machines. I designed it in windows, and my friend uses kali linux, the wigdets were misplaced and resized. Source: Python..
So, I’ve been trying to bind the enter key to press the button I have in this python program — yes I’ve seen the numerous other questions related to this, but none of their code worked with this program for whatever reason. Posting code below to see if anyone has a good solution. The below ..
The problem is idk how to make a vertical style multiple choice question quiz asking for the capitals of countries and allowing for a multiple choice to choose the correct country. I currently have made a welcome home frame for asking for the users name and age to enter my quiz and I’m stuck on ..
Hi I’m a beginner and i’m trying to make a login function where I combine a drop down menu and a checkbox. How can I combine these in one window because it currently makes 2 which is annoying. Could I also make it so that I have to check the box in order to click ..
I’m trying to embed a matplotlib plot in a PyQt GUI, I designed the GUI using Qt Designer and embedded the plot using the ‘upgrade widget’ method. Here is a sample of my plot widget code: from PyQt5 import QtWidgets, QtCore from matplotlib.figure import Figure from matplotlib.backends.backend_qt5agg import FigureCanvasQTAgg as Canvas import matplotlib as mpl ..
def resize_image(img): width, height = int(img.size), int(img.size) if width > height: height = int(300/width*height) width = 300 elif height > width: width = int(250/height*width) height = 250 else: width, height = 250, 250 img = img.resize((width, height)) return img (this error of width before the operator is showing up ? can any one solve this ..
I am trying to achieve the following behaviour: Mutually exclusive textboxes (Entry labels), that follow rules like Only two boxes out of 3 can have text entered at once (content must be deleted to re-enable the third) Filling one box disables a set of subjects. (Not required, nice to have) A tooltip that comes up ..