diff options
author | Tom Rondeau | 2011-09-23 17:03:32 -0400 |
---|---|---|
committer | Tom Rondeau | 2011-09-23 17:08:37 -0400 |
commit | 801465fe8dbac9905ac74aeb5c3dc308d3328d98 (patch) | |
tree | 101ac17fc2ccfa6e5a3617d023de7c1ca1a5b423 /gnuradio-examples/python/pfb/resampler.py | |
parent | b6f2b4138be9dc9d250dda819f901872c13876be (diff) | |
download | gnuradio-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/resampler.py')
-rwxr-xr-x | gnuradio-examples/python/pfb/resampler.py | 34 |
1 files changed, 33 insertions, 1 deletions
diff --git a/gnuradio-examples/python/pfb/resampler.py b/gnuradio-examples/python/pfb/resampler.py index 6be7cf14e..7b296ca71 100755 --- a/gnuradio-examples/python/pfb/resampler.py +++ b/gnuradio-examples/python/pfb/resampler.py @@ -1,7 +1,39 @@ #!/usr/bin/env python +# +# Copyright 2009 Free Software Foundation, Inc. +# +# This file is part of GNU Radio +# +# GNU Radio is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 3, or (at your option) +# any later version. +# +# GNU Radio is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with GNU Radio; see the file COPYING. If not, write to +# the Free Software Foundation, Inc., 51 Franklin Street, +# Boston, MA 02110-1301, USA. +# 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) class mytb(gr.top_block): def __init__(self, fs_in, fs_out, fc, N=10000): |