On Fri, May 14, 2010 at 2:37 AM, Dave Angel <da...@dejaviewphoto.com> wrote: > The other approach is to have the user type in the text according to some > escaping language (like the one used for literals), and explicitly decode > that after the raw_input(). I thought there was a way in the stdlib, but I > can't seem to find it right now. >
the str.decode method has a 'string_escape' encoding: Python 2.6.5 (r265:79063, Apr 16 2010, 13:09:56) [GCC 4.4.3] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> print raw_input('prompt: ').decode('string_escape') prompt: hello\nhello hello hello >>> Hugo _______________________________________________ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor