467,908 Members | 1,851 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 467,908 developers. It's quick & easy.

Change in interactive interpreter?

I remember the interactive interpreter used to define the name _ to
return the value of the last expression that was evaluated. However, I
tried it just today and got a NameError. Is this a change in the
interpreter or is there a configuration option I need to set to enable it?

Thanks!

--
code.py: A blog about life, the universe, and Python

http://pythonista.wordpress.com
** Posted from http://www.teranews.com **
Jun 27 '08 #1
  • viewed: 845
Share:
2 Replies
The Pythonista wrote:
I remember the interactive interpreter used to define the name _ to
return the value of the last expression that was evaluated. However, I
tried it just today and got a NameError. Is this a change in the
interpreter or is there a configuration option I need to set to enable it?

Thanks!

Try again. I think you'll find it's still there -- although you have to
execute a something that returns a value before it's set for the first time.

Gary Herron
Jun 27 '08 #2
On Fri, 06 Jun 2008 11:36:13 -0700, Gary Herron wrote:
Try again. I think you'll find it's still there -- although you have to
execute a something that returns a value before it's set for the first
time.
That was, indeed the problem. Boy do I feel silly now. :-)

Thanks

--
code.py: A blog about life, the universe, and Python

http://pythonista.wordpress.com
** Posted from http://www.teranews.com **
Jun 27 '08 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

147 posts views Thread by Sateesh | last post: by
6 posts views Thread by Avi Berkovich | last post: by
2 posts views Thread by Miki Tebeka | last post: by
10 posts views Thread by notejam | last post: by
reply views Thread by Simon Eves | last post: by
4 posts views Thread by yan.python | last post: by
3 posts views Thread by Sal | last post: by
3 posts views Thread by R. Bernstein | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.