How do I access the last "un-caught" variable in the interpreter?

Michal Wallace sabren at manifestation.com
Wed Jun 20 00:45:54 EDT 2001


On 19 Jun 2001, Dan Moskowitz wrote:

> Pretty simple question:
> 
> >>> 2+2
> 4
> >>> # can i access the 4 if i didn't catch it in a var?
> 
> Is there some variable for the last result returned from the
> interpreter?  I thought that I used to know how to do it, but I've
> forgotten.  Anyone know?

The magical underscore. ONLY works with the interpreter though.

>>> 2+2
4
>>> _
4
>>>


Cheers,

- Michal
------------------------------------------------------------------------
www.manifestation.com  www.sabren.net  www.linkwatcher.com  www.zike.net
------------------------------------------------------------------------





More information about the Python-list mailing list