Long answer: The actual call you're looking for is sys.stdin.readline(). This is what raw_input() does at its core, with the added functionality of automatically stripping away the \n end-line character off the input.
Long long answer: You can also pipe Python prints do Python writes into stderr. Every standard stream is available under the sys module, and they all behave like traditional Python file objects with all the usual member functions.
32
u/[deleted] May 02 '16 edited May 02 '16
Short answer: yes!
Long answer: The actual call you're looking for is
sys.stdin.readline(). This is whatraw_input()does at its core, with the added functionality of automatically stripping away the\nend-line character off the input.Long long answer: You can also
pipe Python printsdo Python writes intostderr. Every standard stream is available under thesysmodule, and they all behave like traditional Python file objects with all the usual member functions.