diff options
author | Andrej Rode <mail@andrejro.de> | 2018-06-23 23:41:42 +0200 |
---|---|---|
committer | Andrej Rode <mail@andrejro.de> | 2018-06-24 00:03:35 +0200 |
commit | 167a6152bad060fc53dd29e0fa79ef83eff1be5b (patch) | |
tree | a01049672d9d7d1bf3d295ed96698a323941f8e8 /gr-utils/python/utils/gr_plot_const | |
parent | 3c8e6008b092287246234001db7cf1a4038300da (diff) | |
parent | fcd002b6ac82e1e0c1224e24506410ff0833e1aa (diff) |
Merge branch 'python3_fix' into next
Manual merge conflict resolution has been applied to following
conflicts:
* Typos:
* gnuradio-runtime/python/gnuradio/ctrlport/GrDataPlotter.py
* gr-blocks/python/blocks/qa_wavfile.py
* gr-filter/examples/gr_filtdes_api.py
* grc/blocks/parameter.xml
* gr-uhd/python/uhd/__init__.py
* ValueError -> RuntimeError:
* gr-blocks/python/blocks/qa_hier_block2.py
* relative Imports & other Py3k:
* gr-digital/python/digital/psk_constellations.py
* gr-digital/python/digital/qam_constellations.py
* gr-digital/python/digital/test_soft_decisions.py
* gr-digital/python/digital/gfsk.py
* SequenceCompleter:
* gr-utils/python/modtool/modtool_add.py
* gr-utils/python/modtool/modtool_rename.py
* gr-utils/python/modtool/modtool_rm.py
* Updated API on next:
* gr-blocks/grc/blocks_file_source.xml
* gr-blocks/python/blocks/qa_file_source_sink.py
* gr-qtgui/grc/qtgui_time_sink_x.xml
* GRC Py3k Updates:
* grc/core/Block.py
* grc/core/Constants.py
* grc/core/Platform.py
* grc/core/utils/odict.py
* grc/gui/Actions.py
* grc/gui/Block.py
* grc/gui/Executor.py
* grc/gui/Port.py
Diffstat (limited to 'gr-utils/python/utils/gr_plot_const')
-rwxr-xr-x | gr-utils/python/utils/gr_plot_const | 21 |
1 files changed, 10 insertions, 11 deletions
diff --git a/gr-utils/python/utils/gr_plot_const b/gr-utils/python/utils/gr_plot_const index 653a2539b4..2ec54c3585 100755 --- a/gr-utils/python/utils/gr_plot_const +++ b/gr-utils/python/utils/gr_plot_const @@ -20,18 +20,20 @@ # Boston, MA 02110-1301, USA. # +from __future__ import print_function + 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 * from matplotlib.font_manager import fontManager, FontProperties 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) from argparse import ArgumentParser @@ -83,7 +85,7 @@ class draw_constellation: try: iq = scipy.fromfile(self.hfile, dtype=self.datatype, count=self.block_length) except MemoryError: - print "End of File" + print("End of File") else: # retesting length here as newer version of scipy does not throw a MemoryError, just # returns a zero-length array @@ -94,7 +96,7 @@ class draw_constellation: self.time = scipy.array([i*(1/self.sample_rate) for i in range(len(self.reals))]) return True else: - print "End of File" + print("End of File") return False def make_plots(self): @@ -215,9 +217,9 @@ class draw_constellation: 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 def main(): @@ -241,6 +243,3 @@ if __name__ == "__main__": main() except KeyboardInterrupt: pass - - - |