求解!为什么这段代码报错啊?
from tkinter import *root=Tk()
v=IntVar()
c=Checkbutton(root,text="fhfvbn",veriable=v)
c.pack()
mainloop()
报错信息:Traceback (most recent call last):
File "C:\Users\25135\Desktop\tk.py", line 7, in <module>
c=Checkbutton(root,text="fhfvbn",veriable=v)
File "E:\Python34\lib\tkinter\__init__.py", line 2453, in __init__
Widget.__init__(self, master, 'checkbutton', cnf, kw)
File "E:\Python34\lib\tkinter\__init__.py", line 2091, in __init__
(widgetName, self._w) + extra + self._options(cnf))
_tkinter.TclError: unknown option "-veriable" variable 系统不认识,是否拼写错误 第7行应该是
c=Checkbutton(root,text="fhfvbn",variable=v) # variable 写成了 veriable
页:
[1]