ivanov / ipython-trainingwheels

A beginner student friendly profile for IPython notebook
4 stars 2 forks source link

Display all variables #45

Open BernhardKonrad opened 10 years ago

BernhardKonrad commented 10 years ago

To avoid confusion with what variables are currently defined we could add a button with something like

import pprint
pprint.pprint(locals())

Or even better, display (a filtered version of) this output in the side-bar. If real estate becomes an issue maybe a filtered list of the keys is enough.

ivanov commented 10 years ago

Adapting something like the approach taken in this widget example might be a good way to get started here: http://nbviewer.ipython.org/github/ipython/ipython/blob/master/examples/Interactive%20Widgets/Variable%20Inspector.ipynb

BernhardKonrad commented 10 years ago

The variable inspector widget is fantastic! Is there a way to execute this python code without pasting into a new cell, execute the cell, delete the cell?

ivanov commented 10 years ago

sure, use IPython.notebook.kernel.execute("stuff to execute goes here")

ivanov commented 10 years ago

but actually, that might not work, because that might not get the response back on the page and into the widget area...