+ 3
expected an idented block
addlabel=sun.Label(window,text="You: "+entry.get()) Help please its giving me this error
11 Answers
+ 7
Reposting link to code for others
https://code.sololearn.com/cssSc7r2CJx0/?ref=app
+ 6
The link provided does not function as expected for me. try saving the code as public in code playground
+ 2
Ok I did
+ 2
tkinter won't run in the playground. It looks like there is a problem on line 14 though. Large space between comma separator and the next argument. I'll check the code out in my IDE though here in a minute.
+ 2
Here's the reformatted code. Also fixed the Title issue (should be title). You had some hidden characters in there but code below should work now. At least it runs and the main window comes up for me that is.
from tkinter import *
class Application(Frame):
def __init__(self, master):
Frame.__init__(self, master)
self.grid()
self.lab1 = Label(self, text="input company\'s \n password")
self.lab2 = Label(self, text="password: ")
self.eta = Entry(self)
self.but = Button(self, text="submit", command=self.rok)
self.txt = Text(self, height=5, width=35, wrap=WORD)
self.take_care()
def take_care(self):
self.lab1.grid(row=0, column=0, columnspan=2, sticky=W)
self.lab2.grid(row=1, column=0, sticky=W)
self.eta.grid(row=1, column=1, sticky=W)
self.but.grid(row=2, column=0, sticky=W)
self.txt.grid(row=3, column=0, columnspan=2, sticky=W)
def rok(self):
sok = self.eta.get()
if sok == "1235":
message = "welcome!"
else:
message = "wrong"
self.txt.delete(0.0, END)
self.txt.insert(0.0, message)
# main
root = Tk()
root.title("trial")
root.geometry("300x200")
app = Application(root)
root.mainloop()
+ 1
you need to post a bigger part
0
What do you mean
0
Can you tell me what I need to fox
0
Fix**
0
At the lab1 input part it says EOL while scanning literal