如何从消息框中消除 {} 括号

发布于 2024-10-21 21:34:31 字数 594 浏览 1 评论 0原文

我有这样的脚本:

rp_1st_name = 1000
rp_last_name = 2000
rp_1st_val = 5555
rp_last_val = 6666
fdh = 200
dif = (rp_1st_val - rp_last_val) - fdh
teor = rp_1st_val - rp_last_val

m1='wysokosc reperu poczatkowego:',rp_1st_val,'mm \n' m2='wysokosc reperu koncowego:',rp_last_val, 'mm \n' m3='przwyzszenie na ciagu: \n' m4='teoretyczne =',teor,'mm \n' m5='obliczone = ',fdh,'mm \n' m6='fdh =',dif,'mm \n'

from easygui import * msgbox((m1, m2, m3, m4, m5, m6),"摘要", ok_button="退出")


How to make {} brackets were not displayed in message box?

I have script like this:

rp_1st_name = 1000
rp_last_name = 2000
rp_1st_val = 5555
rp_last_val = 6666
fdh = 200
dif = (rp_1st_val - rp_last_val) - fdh
teor = rp_1st_val - rp_last_val

m1='wysokosc reperu poczatkowego:',rp_1st_val,'mm \n' m2='wysokosc reperu koncowego:',rp_last_val, 'mm \n' m3='przwyzszenie na ciagu: \n' m4='teoretyczne =',teor,'mm \n' m5='obliczone = ',fdh,'mm \n' m6='fdh =',dif,'mm \n'

from easygui import * msgbox((m1, m2, m3, m4, m5, m6),"SUMMARY", ok_button="Exit")



How to make {} brackets were not displayed in message box?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

妄断弥空 2024-10-28 21:34:31

您似乎认为这

myvar = "String",value,"more string"

会产生一个字符串(String 5 more string),但事实并非如此 -
它给你一个元组 (("String", 5, "more string"))

相反,尝试以下之一

myvar = "String " + str(value) + " more string"  # string concatenation
myvar = "String %d more string" % (value,)       # old-style string formatting
myvar = "String {0} more string".format(value)   # new-style string formatting

You seem to think that

myvar = "String",value,"more string"

results in a string (String 5 more string) but it doesn't -
it gives you a tuple (("String", 5, "more string"))

Instead, try one of

myvar = "String " + str(value) + " more string"  # string concatenation
myvar = "String %d more string" % (value,)       # old-style string formatting
myvar = "String {0} more string".format(value)   # new-style string formatting
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文