input() vs. raw_input()

Dave Brueck dbrueck at edgix.com
Mon Feb 26 10:34:05 EST 2001


raw_input - returns input in its unprocessed ("raw") form
input - gets raw input, sends it to eval(), and returns the result

-Dave

> -----Original Message-----
> From: python-list-admin at python.org
> [mailto:python-list-admin at python.org]On Behalf Of timin at homeSPAMNOT.com
> Sent: Monday, February 26, 2001 8:07 AM
> To: python-list at python.org
> Subject: input() vs. raw_input()
>
>
> For console input to an executing program, I find that raw_input("prompt")
> works very well.  In fact it works the way I would have expected
> input("prompt") to work.  The latter, however, seems to funtion as if the
> input text is part of a program being compiled.  Can someone
> explain what is
> going on here, and why "raw" is part of the name?
>
> --
> "Always yield to temptation, because it may not pass your way again."
>
> --
> http://mail.python.org/mailman/listinfo/python-list





More information about the Python-list mailing list