在此代码中:
#! street.py
# A simple program which tests GUI
import easygui
easygui.msgbox("This programe asks for your info and stores them")
name = easygui.enterbox("What is your name?")
hNumber = easygui.enterbox("What is your house number")
street = easygui.enterbox("What is your post number?")
city = easygui.enterbox("What is your city?")
country = easygui.enterbox("What is your country?")
easygui.msgbox(name +
hNumber +
street +
city +
country)我对最后一个窗口(easygui.msgbox(....))有问题,我想在一个窗口中的不同行显示所有信息,但我只能让它显示在一行上。
\n和类似的东西不起作用。
发布于 2017-07-24 02:57:21
这可能适用于"\n"
easygui.msgbox('\n'.join([
name,
hNumber,
street,
city,
country]))发布于 2018-03-01 11:16:00
我试过了,你可以试试我的修复版本。
import easygui
easygui.msgbox("This programe asks for your info and stores them")
name = easygui.enterbox("What is your name?")
hNumber = easygui.enterbox("What is your house number")
street = easygui.enterbox("What is your post number?")
city = easygui.enterbox("What is your city?")
country = easygui.enterbox("What is your country?")
easygui.msgbox(name + '\n' + hNumber + '\n' + street + '\n' + city + '\n' + country)发布于 2017-07-24 03:21:02
easygui.msgbox(name + "\n" + hNumber + "\n" + street + "\n" +
city + "\n" + country)稍长一点,但也同样有效。
https://stackoverflow.com/questions/45268785
复制相似问题