1

When I do something like

userInput = input("Type in text")

and type in a piece of text like

"""
Line
Break
"""

that I copied from somewhere, the python console only assigns gets the first line, and then the next lines end up as the console thinking I'm trying to find a variable, with

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
NameError: name 'Break' is not defined 

as an error message. How would I get all the user input?

1 Answers1

1
print "ENTER STUFF:"
user_input="\n".join(iter(raw_input,""))

I guess ...

Joran Beasley
  • 110,522
  • 12
  • 160
  • 179
  • 1
    Yeah... not sure what should happen if the OP wants a deliberately blank line inside what looks like a triple quoted string :) – Jon Clements Aug 18 '16 at 23:18