Skip to content

Commit

Permalink
Simple recipe for running example programs in IPython
Browse files Browse the repository at this point in the history
  • Loading branch information
sanguineturtle committed Feb 6, 2015
1 parent 40ca473 commit b1c6a17
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions examples/tests/test_directory_pyfiles.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,24 @@
Just run this file using `python $filename`
"""
#-Subprocess Recipe-#
from subprocess import call
import glob
files = glob.glob("*.py")
for fl in files:
print "Testing File: %s" % fl
call(["python", fl])
print "------------ END (%s) -----------------" % fl

#-IPYTHON NOTEBOOK Recipe-#
#-Instructions-#
#--------------#
#-1. Open an IPython Notebook in quantecon.py/examples/ folder
#-2. Copy the following code recipe into the notebook and run
import glob
files = glob.glob("*.py")
%pylab inline
for fl in files:
print "----RUNNING (%s)----"%fl
%run $fl
print "----END (%s)-----"%fl

0 comments on commit b1c6a17

Please sign in to comment.