如何在 Tkinter 中将 Entry() 输入的变量类型更改为浮点类型

How do I change the variable type for a Entry() input to a float type in Tkinter

如何将 Entry() 输入的变量类型更改为浮点类型

假设您知道如何使用 IntVar()StringVar(),它会是相同的,但使用 DoubleVar()

A brief overview

或者,来自 this website

x = DoubleVar() # Holds a float; default value 0.0

如果这不是你要问的,我鼓励你更具体并包括你自己的代码。