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),"SUMMARY", ok_button="Exit")


如何使{}括号不显示在消息框中?

4

1 回答 1

7

你似乎认为

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
于 2011-03-13T21:22:58.693 回答