就是这个 如果选了 下x[1] 或者 x[2] 为什么会有{}在msg的方框中
import easygui as gmsg = "你愿意为我生猴子吗?"
x = ["愿意","不愿意","!@#$%#&"]
re = g.choicebox(msg,choices = x)
y = []
if re == x:
h = x + "真的是太好了"
y.append(h)
if re == x:
h = x + "那再见 祝你幸福"
y.append(h)
if re == x:
h = x+'尼玛的%s' % x
y.append(h)
g.msgbox(msg = y)
求大佬指点一下 你为什么要搞出来一个列表y呢?
把y相关的都去掉,最后一行的y改为h就搞定了
import easygui as g
msg = "你愿意为我生猴子吗?"
x = ["愿意","不愿意","!@#$%#&"]
re = g.choicebox(msg,choices = x)
if re == x:
h = x + "真的是太好了"
if re == x:
h = x + "那再见 祝你幸福"
if re == x:
h = x+'尼玛的%s' % x
g.msgbox(msg = h)
页:
[1]