[Tutor] Getting multi-line input from user

wormwood_3 wormwood_3 at yahoo.com
Wed Jan 7 13:57:29 CET 2009


Joining with newline works perfectly. 

Thanks everyone!

 _______________________
Samuel Huckins


Homepage - http://samuelhuckins.com
Tech blog - http://dancingpenguinsoflight.com/
Photos - http://www.flickr.com/photos/samuelhuckins/
AIM - samushack | Gtalk - samushack | Skype - shuckins




________________________________
From: Alan Gauld <alan.gauld at btinternet.com>
To: tutor at python.org
Sent: Wednesday, January 7, 2009 3:58:18 AM
Subject: Re: [Tutor] Getting multi-line input from user


"Andre Engels" <andreengels at gmail.com> wrote 
> The newline character is written \n in Python, so if you replace
> 
> ' '.join(user_input)
> 
> by
> 
> '\n'.join(user_input)

Yep, that's better than my suggestion of adding the \n at append time. :-)

Alan G.

_______________________________________________
Tutor maillist  -  Tutor at python.org
http://mail.python.org/mailman/listinfo/tutor
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/tutor/attachments/20090107/c056001e/attachment.htm>


More information about the Tutor mailing list