On Sun, Oct 26, 2014 at 3:25 PM, Malik Brahimi <mbrahim...@gmail.com> wrote:
> So I am working with input that is pasted from a PDF file, and I was
> wondering if there is any way I can do so without the program terminating
> abruptly because of the newlines.

input() and raw_input() grab a single line of text. The rest of the
lines, if any, remain in the input buffer. As you know, you can loop
to build a list and then '\n'.join() the list. To instead grab the
whole buffer, you can use sys.stdin.read(). In this case you need to
manually write EOF to the buffer at the start of a new line. In a
POSIX terminal that's Ctrl-D. In the Windows console use
Ctrl-Z+Return. You may already be familiar with these as a shortcut
for exiting the shell.
_______________________________________________
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor

Reply via email to