diff options
Diffstat (limited to 'gr-utils/python/utils/plot_data.py')
-rw-r--r-- | gr-utils/python/utils/plot_data.py | 22 |
1 files changed, 13 insertions, 9 deletions
diff --git a/gr-utils/python/utils/plot_data.py b/gr-utils/python/utils/plot_data.py index 7d80c714fe..a054147114 100644 --- a/gr-utils/python/utils/plot_data.py +++ b/gr-utils/python/utils/plot_data.py @@ -22,20 +22,24 @@ Utility to help plotting data from files. """ +from __future__ import print_function +from __future__ import division +from __future__ import unicode_literals + try: import scipy except ImportError: - print "Please install SciPy to run this script (http://www.scipy.org/)" - raise SystemExit, 1 + print("Please install SciPy to run this script (http://www.scipy.org/)") + raise SystemExit(1) try: from pylab import * except ImportError: - print "Please install Matplotlib to run this script (http://matplotlib.sourceforge.net/)" - raise SystemExit, 1 + print("Please install Matplotlib to run this script (http://matplotlib.sourceforge.net/)") + raise SystemExit(1) -class plot_data: +class plot_data(object): def __init__(self, datatype, filenames, options): self.hfile = list() self.legend_text = list() @@ -86,10 +90,10 @@ class plot_data: try: f = scipy.fromfile(hfile, dtype=self.datatype, count=self.block_length) except MemoryError: - print "End of File" + print("End of File") else: self.f = scipy.array(f) - self.time = scipy.array([i*(1/self.sample_rate) for i in range(len(self.f))]) + self.time = scipy.array([i*(1 / self.sample_rate) for i in range(len(self.f))]) def make_plots(self): self.sp_f = self.fig.add_subplot(2,1,1, position=[0.075, 0.2, 0.875, 0.6]) @@ -162,6 +166,6 @@ class plot_data: def find(item_in, list_search): try: - return list_search.index(item_in) != None + return list_search.index(item_in) != None except ValueError: - return False + return False |