summaryrefslogtreecommitdiff
path: root/gnuradio-examples
diff options
context:
space:
mode:
authorTom Rondeau2011-09-23 17:21:39 -0400
committerTom Rondeau2011-09-23 17:21:39 -0400
commitc825caf1a86c5cefd20fdd222d915011ef43fbae (patch)
tree92574660e44767cdb7c401ea9299b490600cb4a4 /gnuradio-examples
parentc802032c0198c872ee09b1ec93ce7531f654715c (diff)
downloadgnuradio-c825caf1a86c5cefd20fdd222d915011ef43fbae.tar.gz
gnuradio-c825caf1a86c5cefd20fdd222d915011ef43fbae.tar.bz2
gnuradio-c825caf1a86c5cefd20fdd222d915011ef43fbae.zip
examples: fixed import statements.
Diffstat (limited to 'gnuradio-examples')
-rwxr-xr-xgnuradio-examples/python/ofdm/gr_plot_ofdm.py20
1 files changed, 15 insertions, 5 deletions
diff --git a/gnuradio-examples/python/ofdm/gr_plot_ofdm.py b/gnuradio-examples/python/ofdm/gr_plot_ofdm.py
index e3b347189..b24855148 100755
--- a/gnuradio-examples/python/ofdm/gr_plot_ofdm.py
+++ b/gnuradio-examples/python/ofdm/gr_plot_ofdm.py
@@ -20,14 +20,24 @@
# Boston, MA 02110-1301, USA.
#
-import scipy, pylab, math
-import struct, sys
-from pylab import *
-from matplotlib.font_manager import fontManager, FontProperties
+import math, struct, sys
from optparse import OptionParser
-from scipy import fftpack
from math import log10
+try:
+ import scipy
+ from scipy import fftpack
+except ImportError:
+ print "Error: Program requires scipy (see: www.scipy.org)."
+ sys.exit(1)
+
+try:
+ from pylab import *
+ from matplotlib.font_manager import fontManager, FontProperties
+except ImportError:
+ print "Error: Program requires matplotlib (see: matplotlib.sourceforge.net)."
+ sys.exit(1)
+
matplotlib.interactive(True)
matplotlib.use('TkAgg')