<html><head><style type="text/css"><!-- DIV {margin:0px;} --></style></head><body><div style="font-family:times new roman,new york,times,serif;font-size:12pt">Hello everyone,<br><br>I'd like to prompt the user for input and get back multiple lines, for example if someone wanted to enter a few paragraphs. Then I'd like to be able to print their input out and preserve formatting. Here's what I have so far:<br><br>control = True<br>user_input = []<br>while control:<br> if not user_input:<br> entry = raw_input("Enter text, 'done' on its own line to quit: \n")<br> user_input.append(entry)<br> else:<br> entry = raw_input("")<br> user_input.append(entry)<br> if entry ==
"done":<br> del user_input[-1]<br> control = False<br>user_input = ' '.join(user_input)<br>print user_input<br><br>So you end up with:<br><br>Enter text, 'done' on its own line to quit: <br>I am some text.<br>And I am more.<br><br>I am a new paragraph.<br>done<br>I am some text. And I am more. I am a new paragraph.<br><br>1) Is there a more elegant/common way to get multi-line user input than this sort of thing?<br>2) How can I combine and print the output so that paragraphs and the like are preserved?<br><br>Thanks,<br>Sam<br><div> </div>_______________________<br>Samuel Huckins<br><br><div>Homepage - http://samuelhuckins.com<br>Tech blog - http://dancingpenguinsoflight.com/<br>Photos - http://www.flickr.com/photos/samuelhuckins/<br>AIM - samushack | Gtalk - samushack | Skype -
shuckins<div><br></div></div></div></body></html>