小编Luk*_*ka1的帖子

在tkinter中创建标签的问题

我在tkinter中创建了简单的标签,但它是用{}创建的,我不想这样做.

gameOver=Label(root, text=('Game over!\nYou scored', number, ' points!'),
                               font=('Arial Black', '26'), bg='red')
Run Code Online (Sandbox Code Playgroud)

这是我的代码,其中number是可变的.但它打印出"{Game over!you scored} 0 {points!}"这就是用这段代码得到的(0是值number)

在此输入图像描述

任何解决这个问题的想法都是受欢迎的

python label tkinter

0
推荐指数
1
解决办法
77
查看次数

标签 统计

label ×1

python ×1

tkinter ×1