summaryrefslogtreecommitdiff
path: root/gnuradio-examples/python/pfb/interpolate.py
diff options
context:
space:
mode:
authorTom Rondeau2011-09-23 17:03:32 -0400
committerTom Rondeau2011-09-23 17:08:37 -0400
commit801465fe8dbac9905ac74aeb5c3dc308d3328d98 (patch)
tree101ac17fc2ccfa6e5a3617d023de7c1ca1a5b423 /gnuradio-examples/python/pfb/interpolate.py
parentb6f2b4138be9dc9d250dda819f901872c13876be (diff)
downloadgnuradio-801465fe8dbac9905ac74aeb5c3dc308d3328d98.tar.gz
gnuradio-801465fe8dbac9905ac74aeb5c3dc308d3328d98.tar.bz2
gnuradio-801465fe8dbac9905ac74aeb5c3dc308d3328d98.zip
examples: fixed examples (pfb and tags) to print an error when python modules are not available.
Diffstat (limited to 'gnuradio-examples/python/pfb/interpolate.py')
-rwxr-xr-xgnuradio-examples/python/pfb/interpolate.py23
1 files changed, 15 insertions, 8 deletions
diff --git a/gnuradio-examples/python/pfb/interpolate.py b/gnuradio-examples/python/pfb/interpolate.py
index a7a2522f8..370cf26a7 100755
--- a/gnuradio-examples/python/pfb/interpolate.py
+++ b/gnuradio-examples/python/pfb/interpolate.py
@@ -21,14 +21,21 @@
#
from gnuradio import gr, blks2
-import os
-import scipy, pylab
-from scipy import fftpack
-from pylab import mlab
-import time
-
-#print os.getpid()
-#raw_input()
+import sys, time
+
+try:
+ import scipy
+ from scipy import fftpack
+except ImportError:
+ print "Error: Program requires scipy (see: www.scipy.org)."
+ sys.exit(1)
+
+try:
+ import pylab
+ from pylab import mlab
+except ImportError:
+ print "Error: Program requires matplotlib (see: matplotlib.sourceforge.net)."
+ sys.exit(1)
class pfb_top_block(gr.top_block):
def __init__(self):