##// END OF EJS Templates
Update deepreload to use a rewritten knee.py. Fixes dreload(numpy)....
Update deepreload to use a rewritten knee.py. Fixes dreload(numpy). knee.py, a Python re-implementation of hierarchical module import was removed from the standard library because it no longer functioned properly. deepreload.py is little more than a hacked version of knee.py which overrides __builtin__.__import__ to ensure that each module is re-imported once (before just referring to sys.modules as usual). In addition, `os.path` was added to the default excluded modules, since somehow it has an entry in sys.modules without `os' being a package.

File last commit:

r6453:48b94819
r6531:c0ad0135
Show More
example-demo.py
41 lines | 1.2 KiB | text/x-python | PythonLexer
Fernando Perez
Restore Demo example (and tested that it works)
r4436 """A simple interactive demo to illustrate the use of IPython's Demo class.
Any python script can be run as a demo, but that does little more than showing
it on-screen, syntax-highlighted in one shot. If you add a little simple
markup, you can stop at specified intervals and return to the ipython prompt,
resuming execution later.
"""
Thomas Kluyver
Make print syntax in GUI integration examples Python 3 compatible.
r6453 from __future__ import print_function
Fernando Perez
Restore Demo example (and tested that it works)
r4436
Thomas Kluyver
Make print syntax in GUI integration examples Python 3 compatible.
r6453 print('Hello, welcome to an interactive IPython demo.')
print('Executing this block should require confirmation before proceeding,')
print('unless auto_all has been set to true in the demo object')
Fernando Perez
Restore Demo example (and tested that it works)
r4436
# The mark below defines a block boundary, which is a point where IPython will
# stop execution and return to the interactive prompt.
# Note that in actual interactive execution,
# <demo> --- stop ---
x = 1
y = 2
# <demo> --- stop ---
# the mark below makes this block as silent
# <demo> silent
Thomas Kluyver
Make print syntax in GUI integration examples Python 3 compatible.
r6453 print('This is a silent block, which gets executed but not printed.')
Fernando Perez
Restore Demo example (and tested that it works)
r4436
# <demo> --- stop ---
# <demo> auto
Thomas Kluyver
Make print syntax in GUI integration examples Python 3 compatible.
r6453 print('This is an automatic block.')
print('It is executed without asking for confirmation, but printed.')
Fernando Perez
Restore Demo example (and tested that it works)
r4436 z = x+y
Thomas Kluyver
Make print syntax in GUI integration examples Python 3 compatible.
r6453 print('z=',x)
Fernando Perez
Restore Demo example (and tested that it works)
r4436
# <demo> --- stop ---
# This is just another normal block.
Thomas Kluyver
Make print syntax in GUI integration examples Python 3 compatible.
r6453 print('z is now:', z)
Fernando Perez
Restore Demo example (and tested that it works)
r4436
Thomas Kluyver
Make print syntax in GUI integration examples Python 3 compatible.
r6453 print('bye!')