I'm assuming you are in the Python interactive interpreter, and that you haven't actually used _
to echo it's value! If you did, then the output of your function call is lost.
If you did not echo anything else, but bound _
before, then that's a new global shadowing the interactive interpreter built-in that captured your function output.
Use del _
to remove it and reveal the built-in, that still will hold your function output:
>>> del _
>>> output = _
This works because the built-in _
name is always bound to the last expression result regardless of there being a global _
:
>>> _ = 'foo'
>>> 1 + 1 # an expensive operation!
2
>>> del _
>>> _
2
If you are using IPython, then you can access all results by their output number; if a result is echoed with Out[42]
in front, then use _42
to access the cached result.