From 801465fe8dbac9905ac74aeb5c3dc308d3328d98 Mon Sep 17 00:00:00 2001
From: Tom Rondeau <trondeau@vt.edu>
Date: Fri, 23 Sep 2011 17:03:32 -0400
Subject: examples: fixed examples (pfb and tags) to print an error when python
 modules are not available.

---
 gnuradio-examples/python/pfb/synth_to_chan.py | 14 +++++++++++++-
 1 file changed, 13 insertions(+), 1 deletion(-)

(limited to 'gnuradio-examples/python/pfb/synth_to_chan.py')

diff --git a/gnuradio-examples/python/pfb/synth_to_chan.py b/gnuradio-examples/python/pfb/synth_to_chan.py
index 1beda1a549..7e454d9035 100755
--- a/gnuradio-examples/python/pfb/synth_to_chan.py
+++ b/gnuradio-examples/python/pfb/synth_to_chan.py
@@ -21,7 +21,19 @@
 # 
 
 from gnuradio import gr, blks2
-import scipy, pylab
+import sys 
+
+try:
+    import scipy
+except ImportError:
+    print "Error: Program requires scipy (see: www.scipy.org)."
+    sys.exit(1)
+
+try:
+    import pylab
+except ImportError:
+    print "Error: Program requires matplotlib (see: matplotlib.sourceforge.net)."
+    sys.exit(1)
 
 def main():
     N = 1000000
-- 
cgit v1.2.3