On May 30, 2:04 pm, BartlebyScrivener <[EMAIL PROTECTED]> wrote:
> 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

import sys
s =sys.stdin.read()
print s

which will read until ctrl-d

~Sean

-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to