This is A personal project that i get an error on


when i run the program it reads the label and the first button but not button 2{button2 = Button(app)
button2.configure(" This is Button 2")}
Or past
It runs perfect no errors when i take it out

I expect it to read all the buttons and behave properly

from tkinter import *

root = Tk()

root.title('Simple Gui')

app = Frame(root)

label = Label(app, text = " Label, mainly used for a title")

button1 = Button(app, text="Simple play Button")

button2 = Button(app)
button2.configure(" This is Button 2")

button3 = Button(app)

button3["text"] = "This is a set text"

button4 = Button(app, text="CLOSE GAME; Button 4")



Still can't figure it out


i can't run the code, it gives an error for this line:

button2.configure(" This is Button 2")

looking in the documentation (url), i can't find configure. Are you sure configure is right?


No im somewhat new to python its using tkinter library just trying all the ways of making a button with it


i know, the documentation i linked to is tkinter, i recognized the library, but i couldn't find anything about .configure related to tkinter.


What would it be then im still new to python and tkinter btw


config maybe?


At this point i just want text to appear i replaced the button 2 section with

button2 = Button(app)
button2.text =("This is Button 2")

i get no errors but no text shows up


why not combine it?

button2 = Button(app,text="This is button 2")

i think otherwise you need:

button2.text ("This is Button 2")

without equal sign. I am currently not on my own computer, so i can't test it


This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.