Need help displaying complete output in Jupyter rather than just last result set in Python

0 votes

Hi all,

I have a simple question. My requirement is that I want Jupyter to basically output all of the interactive output to the user. 

This has to be done without using print statements and not just the last recent result obtained.

How can this be done?

Check out the following example for better clarity:

x=3
x
x+1

The output I want for this particular sequence of code is as follows:

3
4

How can I go about doing this? All help appreciated!

Jan 28, 2019 in Python by Anirudh
• 2,090 points
1,195 views

1 answer to this question.

0 votes

Hi, the solution to this is very simple.

Check out the following piece of code for some clarity:

from IPython.core.interactiveshell import InteractiveShell
InteractiveShell.ast_node_interactivity = "all"

So we are making use of the interactive shell and turning the flag to be all. This basically does what you exactly want.

Hope this helped!

answered Jan 28, 2019 by Nymeria
• 3,560 points

Related Questions In Python

0 votes
1 answer

Need help using Joins in Pandas using Python

Hi, there is one scenario where the ...READ MORE

answered Jan 24, 2019 in Python by Nymeria
• 3,560 points
739 views
0 votes
1 answer

Need help to open excel file and read in Python

You can use pandas module to do ...READ MORE

answered Jul 22, 2019 in Python by Tina
960 views
+3 votes
2 answers

how to print array integer without [] bracket in python like result = 1,2,3,4,5

Hey @abhijmr.143, you can print array integers ...READ MORE

answered Aug 5, 2018 in Python by Omkar
• 69,220 points

edited Aug 8, 2018 by Omkar 8,194 views
–1 vote
1 answer
0 votes
1 answer

Need help checking the validity of an image file in Python

I went through the Python documentation and ...READ MORE

answered Jan 18, 2019 in Python by Nymeria
• 3,560 points
2,327 views
0 votes
1 answer
0 votes
1 answer

Need help with making use of Pluck in Python

Hi, good question. Easy solution to be ...READ MORE

answered Jan 24, 2019 in Python by Nymeria
• 3,560 points
1,743 views
0 votes
1 answer

Need help installing easy_install in Python 2.7.1 on Windows 7

That tool is part of the setuptools ...READ MORE

answered Dec 26, 2018 in Python by Nymeria
• 3,560 points
1,209 views
0 votes
1 answer

Need help extracting a schema to make use for an avro file in Python

Hi, nice question. So what I daily use ...READ MORE

answered Jan 10, 2019 in Python by Nymeria
• 3,560 points
5,007 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP