Programming

Python standard input

steloflute 2012. 8. 18. 08:44

http://docs.python.org/library/functions.html#raw_input


raw_input([prompt])

If the prompt argument is present, it is written to standard output without a trailing newline. The function then reads a line from input, converts it to a string (stripping a trailing newline), and returns that. When EOF is read, EOFError is raised. Example:

>>>
>>> s = raw_input('--> ')
--> Monty Python's Flying Circus
>>> s
"Monty Python's Flying Circus"

If the readline module was loaded, then raw_input() will use it to provide elaborate line editing and history features.



cf. http://docs.python.org/library/functions.html#input



'Programming' 카테고리의 다른 글

Pointer based stack in c#  (0) 2012.08.22
Is C Pass by Value or Reference?  (0) 2012.08.21
Python itertools module  (0) 2012.08.16
Calling an external command in Python  (0) 2012.08.14
Anonymous function in Go  (0) 2012.08.13