use*_*750 3 python tkinter tkinter-scale
这是我的代码:
import Tkinter
top = Tkinter.Tk()
top.geometry('600x600')
scale = Tkinter.Scale(top,from_=10,to=40, orient=HORIZONTAL)
scale.pack()
Run Code Online (Sandbox Code Playgroud)
出现以下错误:
NameError: name 'HORIZONTAL' is not defined
我想将比例尺设置为水平,我的参考在这里,但是它不起作用。
HORIZONTAL是Tkinter的变量。如果要使用它,则必须将其导入或使用Tkinter.HORIZONTAL
如果您不想添加Tkinter则可以from Tkinter import HORIZONTAL