I am trying to take an interactive multi-line user input from a jupyter-notebook cell as follows:
contents = []
while True:
line = input()
if line:
contents.append(line)
else:
break
input_text = "\n".join(contents)
Example input text:
This is a multi-line input.
It is good to put several lines after each other.
The reason of this is a good indentation.
One can use both tabs and spaces.
But when I copy paste a multi-line input from somewhere instead of passing it line by line manually, it concatenates into a space separated string like below:
How do I establish copy pasting multi-line text input without arbitrarily adding \n after each line?
