From 3439e0c0bfbbb25d8f5eeebc6af32606d2dc19b6 2009-04-16 12:13:45 From: Tom Fetherston Date: 2009-04-16 12:13:45 Subject: [PATCH] Adresses Fernando Perez review suggestions --- diff --git a/IPython/demo.py b/IPython/demo.py index 6125129..bdf5b4c 100644 --- a/IPython/demo.py +++ b/IPython/demo.py @@ -111,10 +111,10 @@ has a few useful methods for navigation, like again(), edit(), jump(), seek() and back(). It can be reset for a new run via reset() or reloaded from disk (in case you've edited the source) via reload(). See their docstrings below. -Note: To make this simpler to explore, a file called "demoExercizer.py" has +Note: To make this simpler to explore, a file called "demo-exercizer.py" has been added to the \ipython\docs\examples\core. Just cd to this directory in an IPython session, and type: -run demoExercizer.py +run demo-exercizer.py and then follow the directions. Example ======= diff --git a/docs/examples/core/demoExercizer.py b/docs/examples/core/demoExercizer.py deleted file mode 100644 index 5e1ae7c..0000000 --- a/docs/examples/core/demoExercizer.py +++ /dev/null @@ -1,68 +0,0 @@ -from IPython.demo import Demo,IPythonDemo,LineDemo,IPythonLineDemo,ClearDemo,ClearIPDemo -import tempfile, os, StringIO, shutil - -example1 = """ -'''A simple interactive demo to illustrate the use of IPython's Demo class.''' - -print 'Hello, welcome to an interactive IPython demo.' - -# The mark below defines a block boundary, which is a point where IPython will -# stop execution and return to the interactive prompt. The dashes are actually -# optional and used only as a visual aid to clearly separate blocks while -# editing the demo code. -# stop - -x = 1 -y = 2 - -# stop - -# the mark below makes this block as silent -# silent - -print 'This is a silent block, which gets executed but not printed.' - -# stop -# auto -print 'This is an automatic block.' -print 'It is executed without asking for confirmation, but printed.' -z = x+y - -print 'z=',x - -# stop -# This is just another normal block. -print 'z is now:', z - -print 'bye!' -""" -fp = tempfile.mkdtemp(prefix = 'DemoTmp') -fd, filename = tempfile.mkstemp(prefix = 'demoExample1File', suffix = '.py', dir = fp) -f = os.fdopen(fd, 'wt') - -f.write(example1) -f.close() - -my_d = Demo(filename) -my_cd = ClearDemo(filename) - -fobj = StringIO.StringIO(example1) -str_d = Demo(fobj, title='via stringio') -#~ def tmpcleanup(): - #~ global my_d, my_cd, fp - #~ del my_d - #~ del my_cd - #~ shutil.rmtree(fp, False) - -print ''' -The example that is embeded in demo.py file has been used to create -the following 3 demos, and should now be available to use: - my_d() -- created from a file - my_cd() -- created from a file, a ClearDemo - str_d() -- same as above, but created via a stringi\o object -Call by typing their name, (with parentheses), at the -ipython prompt, interact with the block, then call again -to run the next block. -''' -# call tmpcleanup to delete the temporary files created. -not implemented -