[Python] Can't get python to run this file unless the commented "car picture" variable is not...

Discussão em 'Python' iniciado por Stack, Julho 25, 2025.

  1. Stack

    Stack Membro Participativo

    I am working on an app that scans a car and tells you the brand and model of it. I started building it by getting python to give the user the option of selecting Image files. The code below is what I wrote, but It does not seem to work.Please bare in mind that some of settings I selected are for experimentation.

    from tkinter import filedialog # module needed
    import tkinter # module needed
    # create a homepage

    window = tkinter.Tk() #it initializes the main window of your GUI application
    window.title("Car Brand Recognizer") # app name
    window.geometry('550x600+445-60') # height and width

    # homepage will have a welcome

    window.config(bg="#E25098")

    frame = tkinter.Frame(window,width=300,height=200) # master(parental window) and options
    frame.pack(padx=40,pady=40)

    #def scan_picture(car_picture): # enable the user to choose picture
    #car_picture = filedialog.askopenfilename(title = "Open Image Files",filetypes=\[("Image files", "\*.png \*.jpg \*.jpeg \*.gif ")\])

    # function ne``your text``eds to be called\


    I expected the window to show up with a raspberry background colour.

    Continue reading...

Compartilhe esta Página