[英]tkinter spinbox double zeroes
I have a spinbox that needs to have double zeroes, like a clock.我有一个需要有双零的旋转框,就像一个时钟。 No matter what I try, I get only 1. Is it even possible to have a spinbox display double zeroes?
无论我尝试什么,我都只得到 1。是否有可能让旋转框显示双零?
# all give same options: 0 - 15 - 30 - 45
Spinbox(root, from_=00, to=45, increment=15)
Spinbox(root, values=('00', '15', '30', '45'))
Entirely possible!完全有可能! Use the
format=
option.使用
format=
选项。
Spinbox(root, from_=00, to=45, increment=15, format="%02.0f")
That should give you what you need.那应该给你你需要的。 Take a look at the format docs for more information.
查看格式文档以获取更多信息。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.