Python easygui module

Viewed 716

In this code:

#! 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)

I have problems with the last window(easygui.msgbox(....), I want to display all info in a single window at different lines but I can only get it to display on a single line.
\n and similar doesn't work.

4 Answers

Use newest easygui version 0.98.1 and it's multenterbox option.

so your code would be:

#! street.pyw
# A simple program which tests GUI
import easygui
easygui.msgbox("This programe asks for your info and stores them")
info = easygui.multenterbox('Fill fields below','Info',['Name','Number','Street','City','Country'])
first = info[0]
second = info[1]
third = info[2]
fourth = info[3]
fiveth = info[4]
easygui.msgbox(first+'\n'+second+'\n'+third+'\n'+fourth+'\n'+fiveth)

And better save it as scriptname.pyw not scriptname.py.

Related