How to view console output during a project

Take the below project for example. Lets say I wanted to enter print(2+2), or print to the console the output of the variables shown. Normally I use the console for troubleshooting my code – here in many projects it appears unavailable. How do I bring up the console? Is it even possible?

https://www.codecademy.com/paths/data-science/tracks/dspath-visualization-project/modules/dspath-business-metrics/lessons/foodwheel/exercises/orders-over-time-ii

I’m not sure if you can bring up the standard output console in all lessons (but I’d love to be corrected).

Normally you’d have some from of output though. If you have the shell maybe run the script itself with some print statements, .e.g $python script.py. If it’s a wee host page or whatever often used for matplotlib plots you could go around the issue by adding text objects to a plot as an alterantive output (labels, legends and annotations for example). Lastly doing a minimal working example on your own IDE could also help for some of the smaller steps or you could run the entire thing on your own but you may have to extract some of the data that was import ed.

I don’t know how to bring up a console in this project. Codecademy controls the output environment. However, there is a somewhat crude technique you could use to display the values of expressions. See matplotlib.pyplot.figtext.

Example:

plt.figtext(0,0," There are {:d} orders!".format(len(orders)))
plt.show()

Screen Shot 2020-06-25 at 6.58.24 PM

Good workaround. Thanks for your help!!!

1 Like