Reading an exact number of characters from input

2009-04-16 Thread Paddy O'Loughlin
Hi, How would I use python to simply read a specific number of characters from standard input? raw_input() only returns when the user inputs a new line (or some other special character). I tried import sys sys.stdin.read(15) and that *returns* up to 15 characters, but it keeps accepting input

Re: Reading an exact number of characters from input

2009-04-16 Thread Diez B. Roggisch
Paddy O'Loughlin schrieb: Hi, How would I use python to simply read a specific number of characters from standard input? raw_input() only returns when the user inputs a new line (or some other special character). I tried import sys sys.stdin.read(15) and that *returns* up to 15 characters,

Re: Reading an exact number of characters from input

2009-04-16 Thread Scott David Daniels
Paddy O'Loughlin wrote: Hi, How would I use python to simply read a specific number of characters from standard input? raw_input() only returns when the user inputs a new line (or some other special character). I tried import sys sys.stdin.read(15) and that *returns* up to 15 characters, but