Python Tkinter don't create Button -
this question has reply here:
indentationerror: unindent not match outer indentation level 20 answersi'm developing restructuredtext editor tkinter. if run below code, i'm getting indentationerror..
from tkinter import * tkfiledialog import asksaveasfile savefile class rstkinter: def __init__(self): self.pencere_load() self.araclar() def pencere_load(self): pencere.resizable(width=false,height=false) pencere.title("rstkinter") def araclar(self): h1 = button(text=u"başlıklar",command=self.h1p) h1.place(rely=0.0) .. .. topic = button(text="topic",command=self.topic_p) # ..topic:: başlık \n\t içerik topic.place(rely=0.0,relx=0.63) def topic_p(self): topic = toplevel() topic.title("rstkinter - not") topic.resizable(width=false,height=false) topic.geometry("200x140") topic_b_l = label(topic,text=u"topic başlığı: ") topic_b_l.place(relx=0.0,rely=0.0) self.topic_b = text(topic) self.topic_b.place(relx=0.3,rely=0.0,width=130) topic_i_l = label(topic,text=u"topiç içeriği") topic_i_l.place(relx=0.0,rely=0.4) self.topic_i = text(topic) self.topic_i.place(relx=0.3,rely=0.5,width=130) topic_y = button(topic,text=u"ekle",command=self.topic_yap) topic_y.place(relx=0.0,rely=0.2) def topic_yap(self): homecoming self.metin.insert(end,"\n.. topic:: %s \n\t%s"%(self.topic_b.get(1.0,end)),self.topic_i.get(1.0,end))) pencere = tk() rst = rstkinter() mainloop()
full error:
file "rstkinter15.py", line 85 topic = button(text="topic",command=self.topic_p) #.. ^ indentationerror: unexpected indent
how can do?
if error message telling you have indentation error, it's safe assume true. rule of thumb when debugging believe compiler/interpreter telling you.
most you've mixed spaces , tabs -- 1 of python's weaknesses. double-check you're using same combination of spaces , tabs on line , 1 before it.
python tkinter restructuredtext
No comments:
Post a Comment