+ 3

expected an idented block

addlabel=sun.Label(window,text="You: "+entry.get()) Help please its giving me this error

28th Sep 2017, 10:07 PM
Caleb
11 odpowiedzi
+ 7
Reposting link to code for others https://code.sololearn.com/cssSc7r2CJx0/?ref=app
28th Sep 2017, 11:07 PM
jay
jay - avatar
+ 6
The link provided does not function as expected for me. try saving the code as public in code playground
28th Sep 2017, 11:06 PM
jay
jay - avatar
+ 2
Ok I did
28th Sep 2017, 11:06 PM
Caleb
+ 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.
28th Sep 2017, 11:12 PM
ChaoticDawg
ChaoticDawg - avatar
+ 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()
28th Sep 2017, 11:30 PM
ChaoticDawg
ChaoticDawg - avatar
+ 1
you need to post a bigger part
28th Sep 2017, 10:10 PM
smoke bellew
smoke bellew - avatar
0
What do you mean
28th Sep 2017, 10:40 PM
Caleb
0
Can you tell me what I need to fox
28th Sep 2017, 11:08 PM
Caleb
0
Fix**
28th Sep 2017, 11:08 PM
Caleb
0
At the lab1 input part it says EOL while scanning literal
28th Sep 2017, 11:36 PM
Caleb