Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/python/329.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Python Tkinter上的定心刻度命令值_Python_Tkinter - Fatal编程技术网

Python Tkinter上的定心刻度命令值

Python Tkinter上的定心刻度命令值,python,tkinter,Python,Tkinter,我正在尝试将数值0.0从tkinter包移动到Scale命令的中心。 我试图锚定并证明它,但我得到了以下错误:unknown option“-anchor”或unknown option“-justify”。请参见图像以获取视觉示例 编辑: 我试图将0.0值保持在刻度的中心 我冒昧地简化了代码 from tkinter import * root = Tk() root.geometry('800x600') exampleScale = Scale(root, resolution=0.

我正在尝试将数值0.0
tkinter
包移动到
Scale
命令的中心。 我试图锚定并证明它,但我得到了以下错误:
unknown option“-anchor”
unknown option“-justify”
。请参见图像以获取视觉示例

编辑: 我试图将0.0值保持在刻度的中心

我冒昧地简化了代码

from tkinter import *

root = Tk()
root.geometry('800x600')

exampleScale = Scale(root, resolution=0.1, from_=0, to=1, orient=HORIZONTAL,
                     width=250, length=550)
exampleScale.config(font=('Times', 32))
exampleScale.grid(row=1,column=1)

root.mainloop()

提前谢谢你

One tecnique使用
sliderlength
参数的
Scale
设置为字体大小值的两倍:

from tkinter import *

root = Tk()
root.geometry('800x600')

fsize=32
exampleScale = Scale(root, sliderlength=fsize*2, resolution=0.1, from_=0, to=1,
                     orient=HORIZONTAL, width=250, length=550)
exampleScale.config(font=('Times', fsize))
exampleScale.grid(row=1,column=1)


root.mainloop()