How to retrieve the output of the previous command and save it in the variable in the Python interactive shell?

Suppose I run an expensive operation foo(), which returns a large list, but I forgot to save the output of foo() in a variable.

Assuming I run foo() again, I will get a different output.

But the first time I run foo() I do need the output.

Actually Above, I asked if there are some buffers that store the output of the last command that I can read?

_ (single underscore) applies to my python 3 for windows, and also applies to other versions:

>>> 1 + 1
2
>>> x = _
>>> x
2

Suppose I run an expensive operation foo(), which returns a large list, but I forgot to save the output of foo() in a variable.

Assuming I run foo() again, I will get a different output.

But the first time I run foo() I do need the output.

Actually, I asked if there are some buffers that store the output of the last command that I can read?

_(single underscore) applies to my python 3 for windows, and also applies to other versions:

>>> 1 + 1
2
>>> x = _
>>> x
2

WordPress database error: [Table 'yf99682.wp_s6mz6tyggq_comments' doesn't exist]
SELECT SQL_CALC_FOUND_ROWS wp_s6mz6tyggq_comments.comment_ID FROM wp_s6mz6tyggq_comments WHERE ( comment_approved = '1' ) AND comment_post_ID = 2740 ORDER BY wp_s6mz6tyggq_comments.comment_date_gmt ASC, wp_s6mz6tyggq_comments.comment_ID ASC

Leave a Comment

Your email address will not be published.