将slider_value分配给python中的变量

时间:2017-05-18 17:00:50

标签: python tkinter slider

好的,这是我遇到问题的代码。

from guizero import App, Text, TextBox, PushButton, Slider, Picture

def change_number(slider_value):
    global



int_number
        int_number = slider_value
    str_number=str(int_number)

app = App(title="Hello World")

int_number=1
str_number=str(int_number)

picture = Picture(app, image= str_number+".gif")

update_image_number = Slider(app, command=change_number, start=1, end=3)

print_number = Text(app, text=str_number, size=15, font="Comic Sans", color="darkblue" )


app.display()

因为我已经说过我正在尝试使用Slider函数来生成字符串" 1"," 2"和" 3",然后将它们连接到" .gif"为了根据名称更改要显示的图像。但它不起作用,但现在我没有错误。有任何想法吗?感谢

0 个答案:

没有答案