paste text with newlines into raw_input?

BartlebyScrivener bscrivener42 at gmail.com
Wed May 30 17:04:12 EDT 2007


Using Python on Debian Etch.

What is the best way to paste a block of text in at the command
prompt.

I'm trying something like:

Quote = raw_input("Paste quote here: ")

Which works great for one line of text with a single newline. It gets
stripped. Okay.

Is there a way to paste in a block of text that has multiple lines and
newlines? I don't care if they all get stripped in the process, in
fact I'd prefer it. I've used strip before, but that doesn't seem to
work until you get the text into the program.

Thanks for any help.

Rick




More information about the Python-list mailing list