IndentationError期望缩进的块风= tk()

时间:2019-02-23 15:01:06

标签: python-2.7

#encoding:utf-8

从tkinter导入* 从tkinter导入ttk 导入sqlite3 班级用户:

db_name ='database.db'    def init (自我,风):     self.wind =风     self.wind.title(“用户”)

frame = LabelFrame (self.wind, text = 'add new user')
frame.grid (row = 0, column = 1)

Label (frame, text = 'Name:').grid (row = 1, column = 1)
self.name = Entry (frame)
self.name.grid (row = 1, column = 2)

Label (frame, text = 'Mac_add').grid (row = 2, column = 1)
self.Mac_add = Entry (frame)
self.Mac_add.grid (row = 2, column = 2)

ttk.Button (frame, text = 'add_user').grid (row = 3, column = 2)
self.message = Label (text ='', fg = 'red')
self.message.grid (row = 3, column = 0)

self.tree = ttk.treeview (height = 10, colums = 2)
self.tree.grid (row = 4, column = 0, columnspan = 2)
self.tree.heading ('#0', text = 'Name', anchoer = w)
self.tree.heading (2, text = 'Mac_add', anchor = w)

ttk.Button (text = 'Delete record').grid (row = 5, column = 0)
ttk.Button (text = 'Edit record').grid (row = 5, column = 1)



if __name__ == '__main__':
name = TK()
application = users (wind)
wind.mainloop()

0 个答案:

没有答案