Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
labels = [] global labels #blablbalabla code welcome = Tkinter.Label(root,text= "Welcome to Fobby").place(x=250,y=250) labels.append(welcome) print labels >>> [None]
怎么了?标签是与列表不兼容的类吗?
这是因为place()返回 None:
place()
labels = [] welcome = Tkinter.Label(root,text= "Welcome to Fobby") welcome.place(x=250,y=250) labels.append(welcome) print labels