commit-gnuradio
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Commit-gnuradio] [gnuradio] 18/20: python3: futurize --stage1 --write $


From: git
Subject: [Commit-gnuradio] [gnuradio] 18/20: python3: futurize --stage1 --write $(find . -iname '*.py')
Date: Sun, 25 Dec 2016 04:00:00 +0000 (UTC)

This is an automated email from the git hooks/post-receive script.

jcorgan pushed a commit to branch python3
in repository gnuradio.

commit 63da9c51d539ff6d7852b78a269a73f425ccb51e
Author: Douglas Anderson <address@hidden>
Date:   Fri Dec 23 13:55:05 2016 -0700

    python3: futurize --stage1 --write $(find . -iname '*.py')
---
 docs/sphinx/hieroglyph/hieroglyph.py               |  5 ++-
 gnuradio-runtime/apps/evaluation_random_numbers.py |  3 +-
 gnuradio-runtime/examples/mp-sched/affinity_set.py |  3 +-
 gnuradio-runtime/examples/mp-sched/synthetic.py    | 25 +++++------
 .../examples/volk_benchmark/volk_math.py           |  7 ++--
 .../examples/volk_benchmark/volk_test_funcs.py     |  3 +-
 .../examples/volk_benchmark/volk_types.py          |  7 ++--
 .../gnuradio/ctrlport/GNURadioControlPortClient.py |  5 ++-
 .../python/gnuradio/ctrlport/__init__.py           |  3 +-
 gnuradio-runtime/python/gnuradio/eng_notation.py   |  2 +-
 gnuradio-runtime/python/gnuradio/eng_option.py     |  3 +-
 gnuradio-runtime/python/gnuradio/gr/__init__.py    | 11 ++---
 gnuradio-runtime/python/gnuradio/gr/gateway.py     |  1 +
 .../python/gnuradio/gr/gr_threading.py             |  5 ++-
 .../python/gnuradio/gr/packet_utils.py             |  1 +
 gnuradio-runtime/python/gnuradio/gr/pubsub.py      | 10 ++---
 .../python/gnuradio/gr/qa_tag_utils.py             |  3 +-
 gnuradio-runtime/python/gnuradio/gr/tag_utils.py   |  8 ++--
 gnuradio-runtime/python/gnuradio/gr/top_block.py   |  5 ++-
 gnuradio-runtime/python/gnuradio/gr_unittest.py    |  3 +-
 gnuradio-runtime/python/gnuradio/gru/__init__.py   | 21 +++++-----
 gnuradio-runtime/python/gnuradio/gru/freqz.py      |  2 +-
 .../python/gnuradio/gru/seq_with_cursor.py         |  2 +-
 gnuradio-runtime/python/pmt/__init__.py            |  5 ++-
 gnuradio-runtime/python/pmt/qa_pmt.py              |  3 +-
 gnuradio-runtime/python/pmt/qa_pmt_to_python.py    |  3 +-
 gr-analog/examples/fmtest.py                       | 11 ++---
 gr-analog/python/analog/__init__.py                | 21 +++++-----
 gr-analog/python/analog/fm_demod.py                |  3 +-
 gr-analog/python/analog/nbfm_rx.py                 |  3 +-
 gr-analog/python/analog/nbfm_tx.py                 |  3 +-
 gr-analog/python/analog/wfm_rcv.py                 |  3 +-
 gr-analog/python/analog/wfm_rcv_fmdet.py           |  3 +-
 gr-analog/python/analog/wfm_rcv_pll.py             |  3 +-
 gr-analog/python/analog/wfm_tx.py                  |  3 +-
 gr-audio/examples/python/dial_tone_daemon.py       |  3 +-
 gr-audio/examples/python/test_resampler.py         |  5 ++-
 gr-blocks/python/blocks/__init__.py                |  3 +-
 gr-blocks/python/blocks/qa_bin_statistics.py       |  9 ++--
 gr-blocks/python/blocks/qa_file_metadata.py        |  3 +-
 .../python/blocks/qa_stream_to_tagged_stream.py    |  2 +-
 gr-channels/python/channels/__init__.py            | 19 +++++----
 gr-channels/python/channels/impairments.py         |  9 ++--
 gr-digital/python/digital/__init__.py              | 49 +++++++++++-----------
 gr-digital/python/digital/bpsk.py                  |  3 +-
 gr-digital/python/digital/cpm.py                   |  3 +-
 gr-digital/python/digital/generic_mod_demod.py     |  5 ++-
 gr-digital/python/digital/gfsk.py                  |  3 +-
 gr-digital/python/digital/gmsk.py                  |  3 +-
 gr-digital/python/digital/ofdm.py                  |  7 ++--
 gr-digital/python/digital/ofdm_packet_utils.py     |  3 +-
 gr-digital/python/digital/ofdm_receiver.py         |  9 ++--
 gr-digital/python/digital/ofdm_txrx.py             |  3 +-
 gr-digital/python/digital/packet_utils.py          |  3 +-
 gr-digital/python/digital/pkt.py                   |  3 +-
 gr-digital/python/digital/psk.py                   |  9 ++--
 gr-digital/python/digital/psk_constellations.py    |  3 +-
 .../python/digital/qa_constellation_receiver.py    |  4 +-
 gr-digital/python/digital/qa_probe_density.py      |  3 +-
 gr-digital/python/digital/qam.py                   | 11 ++---
 gr-digital/python/digital/qam_constellations.py    |  3 +-
 gr-digital/python/digital/qamlike.py               |  3 +-
 gr-digital/python/digital/qpsk.py                  |  5 ++-
 gr-digital/python/digital/test_soft_decisions.py   |  7 ++--
 gr-digital/python/digital/utils/tagged_streams.py  |  1 +
 gr-dtv/python/dtv/__init__.py                      |  3 +-
 gr-dtv/python/dtv/atsc_rx.py                       |  3 +-
 gr-fec/python/fec/LDPC/Generate_LDPC_matrix.py     |  3 +-
 gr-fec/python/fec/LDPC/__init__.py                 |  3 +-
 gr-fec/python/fec/__init__.py                      | 25 +++++------
 gr-fec/python/fec/_qa_helper.py                    |  5 ++-
 gr-fec/python/fec/bercurve_generator.py            |  3 +-
 gr-fec/python/fec/extended_async_encoder.py        |  3 +-
 gr-fec/python/fec/extended_decoder.py              |  9 ++--
 gr-fec/python/fec/extended_encoder.py              |  7 ++--
 gr-fec/python/fec/extended_tagged_decoder.py       |  5 ++-
 gr-fec/python/fec/extended_tagged_encoder.py       |  3 +-
 gr-fec/python/fec/fec_test.py                      |  7 ++--
 gr-fec/python/fec/polar/__init__.py                |  8 ++--
 gr-fec/python/fec/polar/channel_construction.py    | 11 ++---
 .../python/fec/polar/channel_construction_awgn.py  |  5 ++-
 .../python/fec/polar/channel_construction_bec.py   |  3 +-
 gr-fec/python/fec/polar/common.py                  |  3 +-
 gr-fec/python/fec/polar/decoder.py                 |  5 ++-
 gr-fec/python/fec/polar/encoder.py                 |  5 ++-
 gr-fec/python/fec/polar/testbed.py                 |  9 ++--
 gr-fec/python/fec/qa_fecapi_cc.py                  |  7 ++--
 gr-fec/python/fec/qa_fecapi_dummy.py               |  7 ++--
 gr-fec/python/fec/qa_fecapi_ldpc.py                |  7 ++--
 gr-fec/python/fec/qa_fecapi_repetition.py          |  7 ++--
 gr-fec/python/fec/qa_polar_decoder_sc.py           |  7 ++--
 gr-fec/python/fec/qa_polar_decoder_sc_list.py      |  7 ++--
 .../python/fec/qa_polar_decoder_sc_systematic.py   |  7 ++--
 gr-fec/python/fec/qa_polar_encoder.py              |  7 ++--
 gr-fec/python/fec/qa_polar_encoder_systematic.py   |  7 ++--
 gr-filter/examples/benchmark_filters.py            |  5 ++-
 gr-filter/examples/channelize.py                   |  9 ++--
 gr-filter/examples/chirp_channelize.py             |  9 ++--
 gr-filter/examples/decimate.py                     |  9 ++--
 gr-filter/examples/fft_filter_ccc.py               |  7 ++--
 gr-filter/examples/fir_filter_ccc.py               |  7 ++--
 gr-filter/examples/fir_filter_fff.py               |  7 ++--
 gr-filter/examples/gr_filtdes_api.py               |  9 ++--
 gr-filter/examples/gr_filtdes_callback.py          | 13 +++---
 gr-filter/examples/gr_filtdes_live_upd.py          |  5 ++-
 gr-filter/examples/gr_filtdes_restrict.py          | 13 +++---
 gr-filter/examples/interpolate.py                  |  9 ++--
 gr-filter/examples/reconstruction.py               |  9 ++--
 gr-filter/examples/resampler.py                    |  3 +-
 gr-filter/examples/synth_filter.py                 |  5 ++-
 gr-filter/examples/synth_to_chan.py                |  9 ++--
 gr-filter/python/filter/__init__.py                | 11 ++---
 gr-filter/python/filter/qa_fft_filter.py           |  4 +-
 gr-filter/python/filter/qa_pm_remez.py             |  4 +-
 gr-filter/python/filter/qa_rational_resampler.py   |  5 ++-
 gr-qtgui/apps/plot_psd_base.py                     |  8 ++--
 gr-qtgui/apps/plot_spectrogram_base.py             |  8 ++--
 gr-qtgui/apps/plot_time_base.py                    |  8 ++--
 gr-qtgui/apps/plot_time_raster_base.py             |  8 ++--
 gr-qtgui/apps/uhd_display.py                       | 13 +++---
 gr-qtgui/examples/pyqt_const_c.py                  |  9 ++--
 gr-qtgui/examples/pyqt_example_c.py                |  9 ++--
 gr-qtgui/examples/pyqt_example_f.py                |  9 ++--
 gr-qtgui/examples/pyqt_freq_c.py                   |  9 ++--
 gr-qtgui/examples/pyqt_freq_f.py                   |  9 ++--
 gr-qtgui/examples/pyqt_histogram_f.py              |  7 ++--
 gr-qtgui/examples/pyqt_time_c.py                   |  9 ++--
 gr-qtgui/examples/pyqt_time_f.py                   |  9 ++--
 gr-qtgui/examples/pyqt_time_raster_b.py            |  3 +-
 gr-qtgui/examples/pyqt_time_raster_f.py            |  3 +-
 gr-qtgui/examples/pyqt_waterfall_c.py              |  9 ++--
 gr-qtgui/examples/pyqt_waterfall_f.py              |  9 ++--
 gr-trellis/doc/test_tcm.py                         |  5 ++-
 gr-trellis/doc/test_viterbi_equalization1.py       |  5 ++-
 gr-trellis/examples/python/test_tcm.py             | 13 +++---
 gr-trellis/python/trellis/qa_trellis.py            |  2 +-
 gr-uhd/python/uhd/__init__.py                      |  4 +-
 gr-uhd/python/uhd/qa_uhd.py                        |  3 +-
 gr-utils/python/modtool/__init__.py                | 27 ++++++------
 gr-utils/python/modtool/code_generator.py          | 13 +++---
 .../modtool/gr-newmod/docs/doxygen/doxyxml/base.py |  5 ++-
 .../gr-newmod/docs/doxygen/doxyxml/doxyindex.py    |  5 ++-
 .../docs/doxygen/doxyxml/generated/compound.py     |  3 +-
 .../doxygen/doxyxml/generated/compoundsuper.py     | 23 +++++-----
 .../docs/doxygen/doxyxml/generated/index.py        |  3 +-
 .../docs/doxygen/doxyxml/generated/indexsuper.py   |  5 ++-
 .../python/modtool/gr-newmod/python/build_utils.py | 11 ++---
 gr-utils/python/modtool/grc_xml_generator.py       |  3 +-
 gr-utils/python/modtool/modtool_add.py             | 11 ++---
 gr-utils/python/modtool/modtool_base.py            |  5 ++-
 gr-utils/python/modtool/modtool_disable.py         |  5 ++-
 gr-utils/python/modtool/modtool_info.py            |  5 ++-
 gr-utils/python/modtool/modtool_makexml.py         | 11 ++---
 gr-utils/python/modtool/modtool_newmod.py          |  5 ++-
 gr-utils/python/modtool/modtool_rename.py          |  9 ++--
 gr-utils/python/modtool/modtool_rm.py              |  7 ++--
 gr-vocoder/python/vocoder/__init__.py              |  3 +-
 gr-wavelet/python/wavelet/qa_classify.py           |  4 +-
 gr-zeromq/examples/python/client.py                |  9 ++--
 gr-zeromq/examples/python/server.py                |  9 ++--
 gr-zeromq/python/zeromq/__init__.py                |  5 ++-
 gr-zeromq/python/zeromq/rpc_manager.py             |  4 +-
 grc/core/FlowGraph.py                              |  5 ++-
 grc/core/Param.py                                  |  8 ++--
 grc/core/Platform.py                               | 15 +++----
 grc/core/generator/__init__.py                     |  3 +-
 grc/core/utils/__init__.py                         |  9 ++--
 grc/core/utils/epy_block_io.py                     |  2 +-
 grc/core/utils/extract_docs.py                     | 19 +++++----
 grc/gui/ActionHandler.py                           |  5 ++-
 grc/gui/Actions.py                                 |  6 ++-
 grc/gui/Bars.py                                    |  3 +-
 grc/gui/Colors.py                                  |  3 +-
 grc/gui/Config.py                                  |  5 ++-
 grc/gui/Connection.py                              |  9 ++--
 grc/gui/DrawingArea.py                             |  5 ++-
 grc/gui/Element.py                                 |  5 ++-
 grc/gui/FileDialogs.py                             |  9 ++--
 grc/gui/MainWindow.py                              |  2 +-
 grc/gui/NotebookPage.py                            |  9 ++--
 grc/gui/ParserErrorsDialog.py                      |  3 +-
 grc/gui/Platform.py                                |  3 +-
 grc/gui/Preferences.py                             |  9 ++--
 grc/gui/PropsDialog.py                             |  9 ++--
 grc/gui/StateCache.py                              |  5 ++-
 grc/gui/Utils.py                                   |  7 +++-
 grc/gui/external_editor.py                         |  5 ++-
 187 files changed, 719 insertions(+), 546 deletions(-)

diff --git a/docs/sphinx/hieroglyph/hieroglyph.py 
b/docs/sphinx/hieroglyph/hieroglyph.py
index 0056d9a..72975eb 100644
--- a/docs/sphinx/hieroglyph/hieroglyph.py
+++ b/docs/sphinx/hieroglyph/hieroglyph.py
@@ -1,9 +1,10 @@
 from __future__ import print_function
+from __future__ import absolute_import
 
 import re
 
-from errors import HieroglyphError
-from nodes import (Node, Raises, Except, Note, Warning, Returns, Arg,
+from .errors import HieroglyphError
+from .nodes import (Node, Raises, Except, Note, Warning, Returns, Arg,
                    ensure_terminal_blank)
 
 __author__ = 'Robert Smallshire'
diff --git a/gnuradio-runtime/apps/evaluation_random_numbers.py 
b/gnuradio-runtime/apps/evaluation_random_numbers.py
index 069493c..6348192 100644
--- a/gnuradio-runtime/apps/evaluation_random_numbers.py
+++ b/gnuradio-runtime/apps/evaluation_random_numbers.py
@@ -20,6 +20,7 @@
 # Boston, MA 02110-1301, USA.
 #
 
+from __future__ import print_function
 from gnuradio import gr
 import numpy as np
 from scipy.stats import norm, laplace, rayleigh
@@ -40,7 +41,7 @@ laplace_num_bins = 31
 
 rndm = gr.random() # instance of gnuradio random class (gr::random)
 
-print 'All histograms contain',num_tests,'realisations.'
+print('All histograms contain',num_tests,'realisations.')
 
 #*** GENERATE DATA ***#
 
diff --git a/gnuradio-runtime/examples/mp-sched/affinity_set.py 
b/gnuradio-runtime/examples/mp-sched/affinity_set.py
index e6637b4..2a3eddf 100755
--- a/gnuradio-runtime/examples/mp-sched/affinity_set.py
+++ b/gnuradio-runtime/examples/mp-sched/affinity_set.py
@@ -4,6 +4,7 @@
 # Title: Affinity Set Test
 ##################################################
 
+from __future__ import print_function
 from gnuradio import eng_notation
 from gnuradio import gr
 from gnuradio import blocks
@@ -67,6 +68,6 @@ if __name__ == '__main__':
             try:
                 n = int(ret)
            except ValueError:
-                print "Invalid number"
+                print("Invalid number")
            else:
                 tb.filter_filt_0.set_processor_affinity([n,])
diff --git a/gnuradio-runtime/examples/mp-sched/synthetic.py 
b/gnuradio-runtime/examples/mp-sched/synthetic.py
index 16e3973..a80d088 100755
--- a/gnuradio-runtime/examples/mp-sched/synthetic.py
+++ b/gnuradio-runtime/examples/mp-sched/synthetic.py
@@ -19,6 +19,7 @@
 # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
 #
 
+from __future__ import print_function
 from gnuradio import gr, eng_notation
 from gnuradio import blocks, filter
 from gnuradio.eng_arg import eng_float, intx
@@ -90,18 +91,18 @@ def time_it(tb):
     total_user = user + childrens_user
     total_sys  = sys + childrens_sys
     if tb.machine_readable:
-        print "%3d %3d %.3e %7.3f %7.3f %7.3f %7.3f %.6e %.3e" % (
-            tb.npipes, tb.nstages, tb.nsamples, real, total_user, total_sys, 
(total_user+total_sys)/real, tb.flop, tb.flop/real)
+        print("%3d %3d %.3e %7.3f %7.3f %7.3f %7.3f %.6e %.3e" % (
+            tb.npipes, tb.nstages, tb.nsamples, real, total_user, total_sys, 
(total_user+total_sys)/real, tb.flop, tb.flop/real))
     else:
-        print "npipes           %7d"   % (tb.npipes,)
-        print "nstages          %7d"   % (tb.nstages,)
-        print "nsamples         %s"    % 
(eng_notation.num_to_str(tb.nsamples),)
-        print "real             %7.3f" % (real,)
-        print "user             %7.3f" % (total_user,)
-        print "sys              %7.3f" % (total_sys,)
-        print "(user+sys)/real  %7.3f" % ((total_user + total_sys)/real,)
-        print "pseudo_flop      %s"    % (eng_notation.num_to_str(tb.flop),)
-        print "pseudo_flop/real %s"    % 
(eng_notation.num_to_str(tb.flop/real),)
+        print("npipes           %7d"   % (tb.npipes,))
+        print("nstages          %7d"   % (tb.nstages,))
+        print("nsamples         %s"    % 
(eng_notation.num_to_str(tb.nsamples),))
+        print("real             %7.3f" % (real,))
+        print("user             %7.3f" % (total_user,))
+        print("sys              %7.3f" % (total_sys,))
+        print("(user+sys)/real  %7.3f" % ((total_user + total_sys)/real,))
+        print("pseudo_flop      %s"    % (eng_notation.num_to_str(tb.flop),))
+        print("pseudo_flop/real %s"    % 
(eng_notation.num_to_str(tb.flop/real),))
 
 
 if __name__ == "__main__":
@@ -109,7 +110,7 @@ if __name__ == "__main__":
         tb = top()
         time_it(tb)
     except KeyboardInterrupt:
-        raise SystemExit, 128
+        raise SystemExit(128)
 
 
 
diff --git a/gnuradio-runtime/examples/volk_benchmark/volk_math.py 
b/gnuradio-runtime/examples/volk_benchmark/volk_math.py
index 753257c..67ae330 100755
--- a/gnuradio-runtime/examples/volk_benchmark/volk_math.py
+++ b/gnuradio-runtime/examples/volk_benchmark/volk_math.py
@@ -1,5 +1,6 @@
 #!/usr/bin/env python
 
+from __future__ import print_function
 from gnuradio import gr
 from gnuradio import blocks
 import argparse
@@ -87,7 +88,7 @@ def run_tests(func, N, iters):
         res = format_results(func.__name__, t)
         return res
     except AttributeError:
-        print "\tCould not run test. Skipping."
+        print("\tCould not run test. Skipping.")
         return None
 
 def main():
@@ -129,8 +130,8 @@ def main():
     args = parser.parse_args()
 
     if(args.list):
-        print "Available Tests to Run:"
-        print "\n".join(["\t{0}: {1}".format(i,f.__name__) for i,f in 
enumerate(avail_tests)])
+        print("Available Tests to Run:")
+        print("\n".join(["\t{0}: {1}".format(i,f.__name__) for i,f in 
enumerate(avail_tests)]))
         sys.exit(0)
 
     N = int(args.nitems)
diff --git a/gnuradio-runtime/examples/volk_benchmark/volk_test_funcs.py 
b/gnuradio-runtime/examples/volk_benchmark/volk_test_funcs.py
index 0f2c841..b595642 100644
--- a/gnuradio-runtime/examples/volk_benchmark/volk_test_funcs.py
+++ b/gnuradio-runtime/examples/volk_benchmark/volk_test_funcs.py
@@ -1,5 +1,6 @@
 #!/usr/bin/env python
 
+from __future__ import print_function
 from gnuradio import gr
 from gnuradio import blocks
 import math, sys, os, time
@@ -143,7 +144,7 @@ def timeit(tb, iterations):
     '''
     r = gr.enable_realtime_scheduling()
     if r != gr.RT_OK:
-        print "Warning: failed to enable realtime scheduling"
+        print("Warning: failed to enable realtime scheduling")
 
     times = []
     for i in xrange(iterations):
diff --git a/gnuradio-runtime/examples/volk_benchmark/volk_types.py 
b/gnuradio-runtime/examples/volk_benchmark/volk_types.py
index 546e962..591c47b 100755
--- a/gnuradio-runtime/examples/volk_benchmark/volk_types.py
+++ b/gnuradio-runtime/examples/volk_benchmark/volk_types.py
@@ -1,5 +1,6 @@
 #!/usr/bin/env python
 
+from __future__ import print_function
 from gnuradio import gr
 from gnuradio import blocks
 import argparse
@@ -105,7 +106,7 @@ def run_tests(func, N, iters):
         res = format_results(func.__name__, t)
         return res
     except AttributeError:
-        print "\tCould not run test. Skipping."
+        print("\tCould not run test. Skipping.")
         return None
 
 def main():
@@ -153,8 +154,8 @@ def main():
     args = parser.parse_args()
 
     if(args.list):
-        print "Available Tests to Run:"
-        print "\n".join(["\t{0}: {1}".format(i,f.__name__) for i,f in 
enumerate(avail_tests)])
+        print("Available Tests to Run:")
+        print("\n".join(["\t{0}: {1}".format(i,f.__name__) for i,f in 
enumerate(avail_tests)]))
         sys.exit(0)
 
     N = int(args.nitems)
diff --git 
a/gnuradio-runtime/python/gnuradio/ctrlport/GNURadioControlPortClient.py 
b/gnuradio-runtime/python/gnuradio/ctrlport/GNURadioControlPortClient.py
index 87d2cf5..7ce5708 100644
--- a/gnuradio-runtime/python/gnuradio/ctrlport/GNURadioControlPortClient.py
+++ b/gnuradio-runtime/python/gnuradio/ctrlport/GNURadioControlPortClient.py
@@ -27,6 +27,7 @@ Remote Procedure Call (RPC) transports, the Apache Thrift 
middle-ware RPC
 is currently the only supported transport.
 
 """
+from __future__ import print_function
 
 import exceptions
 
@@ -113,7 +114,7 @@ class GNURadioControlPortClient():
         self.client = None
 
         from gnuradio.ctrlport.RPCConnection import RPCMethods
-        if RPCMethods.has_key(rpcmethod):
+        if rpcmethod in RPCMethods:
             from gnuradio.ctrlport.RPCConnectionThrift import 
RPCConnectionThrift
             if rpcmethod == 'thrift':
                 #print("making RPCConnectionThrift")
@@ -128,5 +129,5 @@ class GNURadioControlPortClient():
                 if not blockingcallback is None:
                     blockingcallback()
         else:
-            print("Unsupported RPC method: ", rpcmethod)
+            print(("Unsupported RPC method: ", rpcmethod))
             raise exceptions.ValueError()
diff --git a/gnuradio-runtime/python/gnuradio/ctrlport/__init__.py 
b/gnuradio-runtime/python/gnuradio/ctrlport/__init__.py
index 8f33d65..c8977ae 100644
--- a/gnuradio-runtime/python/gnuradio/ctrlport/__init__.py
+++ b/gnuradio-runtime/python/gnuradio/ctrlport/__init__.py
@@ -1,3 +1,4 @@
+from __future__ import absolute_import
 #
 # Copyright 2012 Free Software Foundation, Inc.
 #
@@ -22,7 +23,7 @@
 
 # import swig generated symbols into the ctrlport namespace
 #from ctrlport_swig import *
-from monitor import *
+from .monitor import *
 
 # import any pure python here
 #import GNURadio
diff --git a/gnuradio-runtime/python/gnuradio/eng_notation.py 
b/gnuradio-runtime/python/gnuradio/eng_notation.py
index d23f900..2019bcf 100644
--- a/gnuradio-runtime/python/gnuradio/eng_notation.py
+++ b/gnuradio-runtime/python/gnuradio/eng_notation.py
@@ -66,7 +66,7 @@ def str_to_num (value):
     try:
         scale = 1.0
         suffix = value[-1]
-        if scale_factor.has_key (suffix):
+        if suffix in scale_factor:
             return float (value[0:-1]) * scale_factor[suffix]
         return float (value)
     except:
diff --git a/gnuradio-runtime/python/gnuradio/eng_option.py 
b/gnuradio-runtime/python/gnuradio/eng_option.py
index ae000fe..4e37ebf 100644
--- a/gnuradio-runtime/python/gnuradio/eng_option.py
+++ b/gnuradio-runtime/python/gnuradio/eng_option.py
@@ -20,10 +20,11 @@
 #
 
 '''Add support for engineering notation to optparse.OptionParser'''
+from __future__ import absolute_import
 
 from copy import copy
 from optparse import Option, OptionValueError
-import eng_notation
+from . import eng_notation
 
 def check_eng_float (option, opt, value):
     try:
diff --git a/gnuradio-runtime/python/gnuradio/gr/__init__.py 
b/gnuradio-runtime/python/gnuradio/gr/__init__.py
index 9717390..40e7700 100644
--- a/gnuradio-runtime/python/gnuradio/gr/__init__.py
+++ b/gnuradio-runtime/python/gnuradio/gr/__init__.py
@@ -24,6 +24,7 @@
 """
 Core contents.
 """
+from __future__ import absolute_import
 
 # This is the main GNU Radio python module.
 # We pull the swig output and the other modules into the gnuradio.gr namespace
@@ -40,11 +41,11 @@ except ImportError:
     __path__.append(os.path.join(dirname, "..", "..", "..", "swig"))
     from runtime_swig import *
 
-from exceptions import *
-from top_block import *
-from hier_block2 import *
-from tag_utils import *
-from gateway import basic_block, sync_block, decim_block, interp_block
+from .exceptions import *
+from .top_block import *
+from .hier_block2 import *
+from .tag_utils import *
+from .gateway import basic_block, sync_block, decim_block, interp_block
 
 # Force the preference database to be initialized
 prefs = prefs.singleton
diff --git a/gnuradio-runtime/python/gnuradio/gr/gateway.py 
b/gnuradio-runtime/python/gnuradio/gr/gateway.py
index 2e46bca..09b96a1 100644
--- a/gnuradio-runtime/python/gnuradio/gr/gateway.py
+++ b/gnuradio-runtime/python/gnuradio/gr/gateway.py
@@ -1,3 +1,4 @@
+from __future__ import print_function
 #
 # Copyright 2011-2012 Free Software Foundation, Inc.
 #
diff --git a/gnuradio-runtime/python/gnuradio/gr/gr_threading.py 
b/gnuradio-runtime/python/gnuradio/gr/gr_threading.py
index 5d6f0fd..db1a1f8 100644
--- a/gnuradio-runtime/python/gnuradio/gr/gr_threading.py
+++ b/gnuradio-runtime/python/gnuradio/gr/gr_threading.py
@@ -1,3 +1,4 @@
+from __future__ import absolute_import
 #
 # Copyright 2005 Free Software Foundation, Inc.
 #
@@ -25,10 +26,10 @@ from sys import version_info as _version_info
 
 if _version_info[0:2] == (2, 3):
     #print "Importing gr_threading_23"
-    from gr_threading_23 import *
+    from .gr_threading_23 import *
 elif _version_info[0:2] == (2, 4):
     #print "Importing gr_threading_24"
-    from gr_threading_24 import *
+    from .gr_threading_24 import *
 else:
     # assume the patch was applied...
     #print "Importing system provided threading"
diff --git a/gnuradio-runtime/python/gnuradio/gr/packet_utils.py 
b/gnuradio-runtime/python/gnuradio/gr/packet_utils.py
index 3dc4e01..2fc9844 100644
--- a/gnuradio-runtime/python/gnuradio/gr/packet_utils.py
+++ b/gnuradio-runtime/python/gnuradio/gr/packet_utils.py
@@ -20,6 +20,7 @@
 # Boston, MA 02110-1301, USA.
 #
 
+from __future__ import print_function
 from gnuradio import gr
 import pmt
 
diff --git a/gnuradio-runtime/python/gnuradio/gr/pubsub.py 
b/gnuradio-runtime/python/gnuradio/gr/pubsub.py
index fb9add2..968f1ef 100644
--- a/gnuradio-runtime/python/gnuradio/gr/pubsub.py
+++ b/gnuradio-runtime/python/gnuradio/gr/pubsub.py
@@ -41,7 +41,7 @@ class pubsub(dict):
         self._proxies[key] = None
 
     def __setitem__(self, key, val):
-        if not self.has_key(key):
+        if key not in self:
             self.__missing__(key, val)
         elif self._proxies[key] is not None:
             (p, newkey) = self._proxies[key]
@@ -54,7 +54,7 @@ class pubsub(dict):
             sub(val)
 
     def __getitem__(self, key):
-        if not self.has_key(key): self.__missing__(key)
+        if key not in self: self.__missing__(key)
         if self._proxies[key] is not None:
             (p, newkey) = self._proxies[key]
             return p[newkey]
@@ -64,7 +64,7 @@ class pubsub(dict):
             return dict.__getitem__(self, key)
 
     def publish(self, key, publisher):
-        if not self.has_key(key): self.__missing__(key)
+        if key not in self: self.__missing__(key)
         if self._proxies[key] is not None:
             (p, newkey) = self._proxies[key]
             p.publish(newkey, publisher)
@@ -72,7 +72,7 @@ class pubsub(dict):
             self._publishers[key] = publisher
 
     def subscribe(self, key, subscriber):
-        if not self.has_key(key): self.__missing__(key)
+        if key not in self: self.__missing__(key)
         if self._proxies[key] is not None:
             (p, newkey) = self._proxies[key]
             p.subscribe(newkey, subscriber)
@@ -94,7 +94,7 @@ class pubsub(dict):
             self._subscribers[key].remove(subscriber)
 
     def proxy(self, key, p, newkey=None):
-        if not self.has_key(key): self.__missing__(key)
+        if key not in self: self.__missing__(key)
         if newkey is None: newkey = key
         self._proxies[key] = (p, newkey)
 
diff --git a/gnuradio-runtime/python/gnuradio/gr/qa_tag_utils.py 
b/gnuradio-runtime/python/gnuradio/gr/qa_tag_utils.py
index 55b62a1..b6978b7 100755
--- a/gnuradio-runtime/python/gnuradio/gr/qa_tag_utils.py
+++ b/gnuradio-runtime/python/gnuradio/gr/qa_tag_utils.py
@@ -20,6 +20,7 @@
 # Boston, MA 02110-1301, USA.
 #
 
+from __future__ import print_function
 from gnuradio import gr, gr_unittest
 
 try:
@@ -111,6 +112,6 @@ class test_tag_utils (gr_unittest.TestCase):
 
 
 if __name__ == '__main__':
-    print 'hi'
+    print('hi')
     gr_unittest.run(test_tag_utils, "test_tag_utils.xml")
 
diff --git a/gnuradio-runtime/python/gnuradio/gr/tag_utils.py 
b/gnuradio-runtime/python/gnuradio/gr/tag_utils.py
index a774542..2b8eab0 100644
--- a/gnuradio-runtime/python/gnuradio/gr/tag_utils.py
+++ b/gnuradio-runtime/python/gnuradio/gr/tag_utils.py
@@ -51,22 +51,22 @@ def python_to_tag(tag_struct):
     good = False
     tag = gr.tag_t()
     if(type(tag_struct) == dict):
-        if(tag_struct.has_key('offset')):
+        if('offset' in tag_struct):
             if(isinstance(tag_struct['offset'], (int,long))):
                 tag.offset = tag_struct['offset']
                 good = True
 
-        if(tag_struct.has_key('key')):
+        if('key' in tag_struct):
             if(isinstance(tag_struct['key'], pmt.pmt_swig.swig_int_ptr)):
                 tag.key = tag_struct['key']
                 good = True
 
-        if(tag_struct.has_key('value')):
+        if('value' in tag_struct):
             if(isinstance(tag_struct['value'], pmt.pmt_swig.swig_int_ptr)):
                 tag.value = tag_struct['value']
                 good = True
 
-        if(tag_struct.has_key('srcid')):
+        if('srcid' in tag_struct):
             if(isinstance(tag_struct['srcid'], pmt.pmt_swig.swig_int_ptr)):
                 tag.srcid = tag_struct['srcid']
                 good = True
diff --git a/gnuradio-runtime/python/gnuradio/gr/top_block.py 
b/gnuradio-runtime/python/gnuradio/gr/top_block.py
index 2efcbd9..89d5df0 100644
--- a/gnuradio-runtime/python/gnuradio/gr/top_block.py
+++ b/gnuradio-runtime/python/gnuradio/gr/top_block.py
@@ -1,3 +1,4 @@
+from __future__ import absolute_import
 #
 # Copyright 2007,2014 Free Software Foundation, Inc.
 #
@@ -25,9 +26,9 @@ from runtime_swig import top_block_swig, \
     top_block_unlock_unlocked, dot_graph_tb
 
 #import gnuradio.gr.gr_threading as _threading
-import gr_threading as _threading
+from . import gr_threading as _threading
 
-from hier_block2 import hier_block2
+from .hier_block2 import hier_block2
 
 class _top_block_waiter(_threading.Thread):
     """
diff --git a/gnuradio-runtime/python/gnuradio/gr_unittest.py 
b/gnuradio-runtime/python/gnuradio/gr_unittest.py
index 7307bca..123a8b1 100755
--- a/gnuradio-runtime/python/gnuradio/gr_unittest.py
+++ b/gnuradio-runtime/python/gnuradio/gr_unittest.py
@@ -22,9 +22,10 @@
 """
 GNU radio specific extension of unittest.
 """
+from __future__ import absolute_import
 
 import unittest
-import gr_xmlrunner
+from . import gr_xmlrunner
 import sys, os, stat
 
 class TestCase(unittest.TestCase):
diff --git a/gnuradio-runtime/python/gnuradio/gru/__init__.py 
b/gnuradio-runtime/python/gnuradio/gru/__init__.py
index 4e41d03..9911225 100644
--- a/gnuradio-runtime/python/gnuradio/gru/__init__.py
+++ b/gnuradio-runtime/python/gnuradio/gru/__init__.py
@@ -1,13 +1,14 @@
+from __future__ import absolute_import
 # make this a package
 
 # Import gru stuff
-from daemon import *
-from freqz import *
-from gnuplot_freqz import *
-from hexint import *
-from listmisc import *
-from mathmisc import *
-from msgq_runner import *
-from os_read_exactly import *
-from seq_with_cursor import *
-from socket_stuff import *
+from .daemon import *
+from .freqz import *
+from .gnuplot_freqz import *
+from .hexint import *
+from .listmisc import *
+from .mathmisc import *
+from .msgq_runner import *
+from .os_read_exactly import *
+from .seq_with_cursor import *
+from .socket_stuff import *
diff --git a/gnuradio-runtime/python/gnuradio/gru/freqz.py 
b/gnuradio-runtime/python/gnuradio/gru/freqz.py
index efaefdc..f05e495 100644
--- a/gnuradio-runtime/python/gnuradio/gru/freqz.py
+++ b/gnuradio-runtime/python/gnuradio/gru/freqz.py
@@ -331,7 +331,7 @@ def freqz(b, a, worN=None, whole=0, plot=None):
     if worN is None:
         N = 512
         w = Num.arange(0,lastpoint,lastpoint/N)
-    elif isinstance(worN, types.IntType):
+    elif isinstance(worN, int):
         N = worN
         w = Num.arange(0,lastpoint,lastpoint/N)
     else:
diff --git a/gnuradio-runtime/python/gnuradio/gru/seq_with_cursor.py 
b/gnuradio-runtime/python/gnuradio/gru/seq_with_cursor.py
index def3299..991cb85 100644
--- a/gnuradio-runtime/python/gnuradio/gru/seq_with_cursor.py
+++ b/gnuradio-runtime/python/gnuradio/gru/seq_with_cursor.py
@@ -51,7 +51,7 @@ class seq_with_cursor (object):
         cv = self.current()
         more = True
         while cv < v and more:
-            cv, more = self.next()      # side effect!
+            cv, more = next(self)      # side effect!
 
     def next (self):
         new_index = self.index + 1
diff --git a/gnuradio-runtime/python/pmt/__init__.py 
b/gnuradio-runtime/python/pmt/__init__.py
index 399fae8..d8027e1 100644
--- a/gnuradio-runtime/python/pmt/__init__.py
+++ b/gnuradio-runtime/python/pmt/__init__.py
@@ -38,6 +38,7 @@ The PMT library supports the following major types:
 bool, symbol (string), integer, real, complex, null, pair, list,
 vector, dict, uniform_vector, any (boost::any cast)
 '''
+from __future__ import absolute_import
 
 import os
 
@@ -55,5 +56,5 @@ PMT_T = get_PMT_T()
 PMT_F = get_PMT_F()
 PMT_EOF = get_PMT_EOF()
 
-from pmt_to_python import pmt_to_python as to_python
-from pmt_to_python import python_to_pmt as to_pmt
+from .pmt_to_python import pmt_to_python as to_python
+from .pmt_to_python import python_to_pmt as to_pmt
diff --git a/gnuradio-runtime/python/pmt/qa_pmt.py 
b/gnuradio-runtime/python/pmt/qa_pmt.py
index 32cff62..4db9ae9 100755
--- a/gnuradio-runtime/python/pmt/qa_pmt.py
+++ b/gnuradio-runtime/python/pmt/qa_pmt.py
@@ -20,6 +20,7 @@
 # Boston, MA 02110-1301, USA.
 #
 
+from __future__ import print_function
 import unittest
 import pmt
 
@@ -30,7 +31,7 @@ class test_pmt(unittest.TestCase):
         b = pmt.from_double(123765)
         d1 = pmt.make_dict()
         d2 = pmt.dict_add(d1, a, b)
-        print d2
+        print(d2)
 
     def test02(self):
         const = 123765
diff --git a/gnuradio-runtime/python/pmt/qa_pmt_to_python.py 
b/gnuradio-runtime/python/pmt/qa_pmt_to_python.py
index e63ade1..c88ab6f 100755
--- a/gnuradio-runtime/python/pmt/qa_pmt_to_python.py
+++ b/gnuradio-runtime/python/pmt/qa_pmt_to_python.py
@@ -20,9 +20,10 @@
 # Boston, MA 02110-1301, USA.
 #
 
+from __future__ import absolute_import
 import unittest
 import pmt
-import pmt_to_python as pmt2py
+from . import pmt_to_python as pmt2py
 
 class test_pmt_to_python(unittest.TestCase):
 
diff --git a/gr-analog/examples/fmtest.py b/gr-analog/examples/fmtest.py
index 7ed08ca..48f5efa 100755
--- a/gr-analog/examples/fmtest.py
+++ b/gr-analog/examples/fmtest.py
@@ -20,6 +20,7 @@
 # Boston, MA 02110-1301, USA.
 #
 
+from __future__ import print_function
 from gnuradio import gr
 from gnuradio import blocks
 from gnuradio import filter
@@ -31,13 +32,13 @@ try:
     import scipy
     from scipy import fftpack
 except ImportError:
-    print "Error: Program requires scipy (see: www.scipy.org)."
+    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)."
+    print("Error: Program requires matplotlib (see: 
matplotlib.sourceforge.net).")
     sys.exit(1)
 
 
@@ -103,9 +104,9 @@ class fmtest(gr.top_block):
                                               
window=filter.firdes.WIN_BLACKMAN_hARRIS)
         tpc = math.ceil(float(len(self._taps)) /  float(self._M))
 
-        print "Number of taps:     ", len(self._taps)
-        print "Number of channels: ", self._M
-        print "Taps per channel:   ", tpc
+        print("Number of taps:     ", len(self._taps))
+        print("Number of channels: ", self._M)
+        print("Taps per channel:   ", tpc)
 
         self.pfb = filter.pfb.channelizer_ccf(self._M, self._taps)
 
diff --git a/gr-analog/python/analog/__init__.py 
b/gr-analog/python/analog/__init__.py
index 3c4a0ff..cf844c5 100644
--- a/gr-analog/python/analog/__init__.py
+++ b/gr-analog/python/analog/__init__.py
@@ -21,6 +21,7 @@
 '''
 Blocks and utilities for analog modulation and demodulation.
 '''
+from __future__ import absolute_import
 
 # The presence of this file turns this directory into a Python package
 import os
@@ -32,13 +33,13 @@ except ImportError:
     __path__.append(os.path.join(dirname, "..", "..", "swig"))
     from analog_swig import *
 
-from am_demod import *
-from fm_demod import *
-from fm_emph import *
-from nbfm_rx import *
-from nbfm_tx import *
-from standard_squelch import *
-from wfm_rcv import *
-from wfm_rcv_fmdet import *
-from wfm_rcv_pll import *
-from wfm_tx import *
+from .am_demod import *
+from .fm_demod import *
+from .fm_emph import *
+from .nbfm_rx import *
+from .nbfm_tx import *
+from .standard_squelch import *
+from .wfm_rcv import *
+from .wfm_rcv_fmdet import *
+from .wfm_rcv_pll import *
+from .wfm_tx import *
diff --git a/gr-analog/python/analog/fm_demod.py 
b/gr-analog/python/analog/fm_demod.py
index 4e3c01d..d754af8 100644
--- a/gr-analog/python/analog/fm_demod.py
+++ b/gr-analog/python/analog/fm_demod.py
@@ -1,3 +1,4 @@
+from __future__ import absolute_import
 #
 # Copyright 2006,2007,2012 Free Software Foundation, Inc.
 #
@@ -20,7 +21,7 @@
 #
 
 from gnuradio import gr, filter
-from fm_emph import fm_deemph
+from .fm_emph import fm_deemph
 from math import pi
 
 try:
diff --git a/gr-analog/python/analog/nbfm_rx.py 
b/gr-analog/python/analog/nbfm_rx.py
index 6f1d38f..904b012 100644
--- a/gr-analog/python/analog/nbfm_rx.py
+++ b/gr-analog/python/analog/nbfm_rx.py
@@ -20,11 +20,12 @@
 #
 
 from __future__ import print_function
+from __future__ import absolute_import
 
 import math
 from gnuradio import gr
 from gnuradio import filter
-from fm_emph import fm_deemph
+from .fm_emph import fm_deemph
 
 try:
     from gnuradio import analog
diff --git a/gr-analog/python/analog/nbfm_tx.py 
b/gr-analog/python/analog/nbfm_tx.py
index 16f7dee..faab45d 100644
--- a/gr-analog/python/analog/nbfm_tx.py
+++ b/gr-analog/python/analog/nbfm_tx.py
@@ -20,10 +20,11 @@
 #
 
 from __future__ import print_function
+from __future__ import absolute_import
 
 import math
 from gnuradio import gr, filter
-from fm_emph import fm_preemph
+from .fm_emph import fm_preemph
 
 try:
     from gnuradio import analog
diff --git a/gr-analog/python/analog/wfm_rcv.py 
b/gr-analog/python/analog/wfm_rcv.py
index 38374bf..5415a34 100644
--- a/gr-analog/python/analog/wfm_rcv.py
+++ b/gr-analog/python/analog/wfm_rcv.py
@@ -1,3 +1,4 @@
+from __future__ import absolute_import
 #
 # Copyright 2005,2007,2012 Free Software Foundation, Inc.
 #
@@ -20,7 +21,7 @@
 #
 
 from gnuradio import gr, filter
-from fm_emph import fm_deemph
+from .fm_emph import fm_deemph
 import math
 
 try:
diff --git a/gr-analog/python/analog/wfm_rcv_fmdet.py 
b/gr-analog/python/analog/wfm_rcv_fmdet.py
index 1946c82..9775a4e 100644
--- a/gr-analog/python/analog/wfm_rcv_fmdet.py
+++ b/gr-analog/python/analog/wfm_rcv_fmdet.py
@@ -1,3 +1,4 @@
+from __future__ import absolute_import
 #
 # Copyright 2005,2006,2012-2013 Free Software Foundation, Inc.
 #
@@ -22,7 +23,7 @@
 from gnuradio import gr
 from gnuradio import blocks
 from gnuradio import filter
-from fm_emph import fm_deemph
+from .fm_emph import fm_deemph
 import math
 
 try:
diff --git a/gr-analog/python/analog/wfm_rcv_pll.py 
b/gr-analog/python/analog/wfm_rcv_pll.py
index adbd4b9..69df323 100644
--- a/gr-analog/python/analog/wfm_rcv_pll.py
+++ b/gr-analog/python/analog/wfm_rcv_pll.py
@@ -1,3 +1,4 @@
+from __future__ import absolute_import
 #
 # Copyright 2005,2006,2012-2013 Free Software Foundation, Inc.
 #
@@ -22,7 +23,7 @@
 from gnuradio import gr
 from gnuradio import blocks
 from gnuradio import filter
-from fm_emph import fm_deemph
+from .fm_emph import fm_deemph
 import math
 
 try:
diff --git a/gr-analog/python/analog/wfm_tx.py 
b/gr-analog/python/analog/wfm_tx.py
index 91fdb2d..7b80668 100644
--- a/gr-analog/python/analog/wfm_tx.py
+++ b/gr-analog/python/analog/wfm_tx.py
@@ -20,11 +20,12 @@
 #
 
 from __future__ import print_function
+from __future__ import absolute_import
 
 import math
 from gnuradio import gr
 from gnuradio import filter
-from fm_emph import fm_preemph
+from .fm_emph import fm_preemph
 
 try:
     from gnuradio import analog
diff --git a/gr-audio/examples/python/dial_tone_daemon.py 
b/gr-audio/examples/python/dial_tone_daemon.py
index 9919e36..eff0a45 100755
--- a/gr-audio/examples/python/dial_tone_daemon.py
+++ b/gr-audio/examples/python/dial_tone_daemon.py
@@ -20,6 +20,7 @@
 # Boston, MA 02110-1301, USA.
 #
 
+from __future__ import print_function
 from gnuradio import gr, gru
 from gnuradio import audio
 from gnuradio.eng_arg import eng_float
@@ -54,5 +55,5 @@ class my_top_block(gr.top_block):
 
 if __name__ == '__main__':
     pid = gru.daemonize()
-    print "To stop this program, enter 'kill %d'" % pid
+    print("To stop this program, enter 'kill %d'" % pid)
     my_top_block().run()
diff --git a/gr-audio/examples/python/test_resampler.py 
b/gr-audio/examples/python/test_resampler.py
index 4d8a923..5787e45 100755
--- a/gr-audio/examples/python/test_resampler.py
+++ b/gr-audio/examples/python/test_resampler.py
@@ -20,6 +20,7 @@
 # Boston, MA 02110-1301, USA.
 #
 
+from __future__ import print_function
 from gnuradio import gr, gru
 from gnuradio import audio
 from gnuradio import filter
@@ -57,8 +58,8 @@ class my_top_block(gr.top_block):
         interp = gru.lcm(input_rate, output_rate) / input_rate
         decim = gru.lcm(input_rate, output_rate) / output_rate
 
-        print "interp =", interp
-        print "decim  =", decim
+        print("interp =", interp)
+        print("decim  =", decim)
 
         ampl = 0.1
         src0 = analog.sig_source_f(input_rate, analog.GR_SIN_WAVE, 650, ampl)
diff --git a/gr-blocks/python/blocks/__init__.py 
b/gr-blocks/python/blocks/__init__.py
index fc4cc7a..8de67dc 100644
--- a/gr-blocks/python/blocks/__init__.py
+++ b/gr-blocks/python/blocks/__init__.py
@@ -22,6 +22,7 @@
 '''
 Processing blocks common to many flowgraphs.
 '''
+from __future__ import absolute_import
 import os
 
 try:
@@ -31,7 +32,7 @@ except ImportError:
     __path__.append(os.path.join(dirname, "..", "..", "swig"))
     from blocks_swig import *
 
-from stream_to_vector_decimator import *
+from .stream_to_vector_decimator import *
 
 #alias old add_vXX and multiply_vXX
 add_vcc = add_cc
diff --git a/gr-blocks/python/blocks/qa_bin_statistics.py 
b/gr-blocks/python/blocks/qa_bin_statistics.py
index 52b8585..5fbea46 100755
--- a/gr-blocks/python/blocks/qa_bin_statistics.py
+++ b/gr-blocks/python/blocks/qa_bin_statistics.py
@@ -20,6 +20,7 @@
 # Boston, MA 02110-1301, USA.
 #
 
+from __future__ import print_function
 from gnuradio import gr, gr_unittest, blocks
 
 import random
@@ -57,8 +58,8 @@ class counter3(gr.feval_dd):
             t = self.count
             self.count = self.count + self.step_size
             self.f(self.count)
-        except Exception, e:
-            print "Exception: ", e
+        except Exception as e:
+            print("Exception: ", e)
         return t
 
 def foobar3(new_t):
@@ -79,8 +80,8 @@ class counter4(gr.feval_dd):
             t = self.count
             self.count = self.count + self.step_size
             self.obj_instance.foobar4(self.count)
-        except Exception, e:
-            print "Exception: ", e
+        except Exception as e:
+            print("Exception: ", e)
         return t
 
 
diff --git a/gr-blocks/python/blocks/qa_file_metadata.py 
b/gr-blocks/python/blocks/qa_file_metadata.py
index 0d7628b..55210de 100644
--- a/gr-blocks/python/blocks/qa_file_metadata.py
+++ b/gr-blocks/python/blocks/qa_file_metadata.py
@@ -20,12 +20,13 @@
 # Boston, MA 02110-1301, USA.
 #
 
+from __future__ import absolute_import
 import os, math
 
 from gnuradio import gr, gr_unittest, blocks
 import pmt
 
-import parse_file_metadata
+from . import parse_file_metadata
 
 def sig_source_c(samp_rate, freq, amp, N):
     t = map(lambda x: float(x)/samp_rate, xrange(N))
diff --git a/gr-blocks/python/blocks/qa_stream_to_tagged_stream.py 
b/gr-blocks/python/blocks/qa_stream_to_tagged_stream.py
index 0d3f503..e762c3a 100755
--- a/gr-blocks/python/blocks/qa_stream_to_tagged_stream.py
+++ b/gr-blocks/python/blocks/qa_stream_to_tagged_stream.py
@@ -34,7 +34,7 @@ class qa_stream_to_tagged_stream (gr_unittest.TestCase):
 
     def test_001_t (self):
         src_data = (1, ) * 50
-        packet_len = 10L
+        packet_len = 10
         len_tag_key = 'packet_len'
         src = blocks.vector_source_f(src_data, False, 1)
         tagger = blocks.stream_to_tagged_stream(gr.sizeof_float, 1, 
packet_len, len_tag_key)
diff --git a/gr-channels/python/channels/__init__.py 
b/gr-channels/python/channels/__init__.py
index ae4c4ab..a2223ec 100644
--- a/gr-channels/python/channels/__init__.py
+++ b/gr-channels/python/channels/__init__.py
@@ -22,6 +22,7 @@
 '''
 Blocks for channel models and related functions.
 '''
+from __future__ import absolute_import
 
 import os
 
@@ -33,12 +34,12 @@ except ImportError:
     from channels_swig import *
 
 # Blocks for Hardware Impairments
-from amp_bal import *
-from conj_fs_iqcorr import *
-from distortion_2_gen import *
-from distortion_3_gen import *
-from iqbal_gen import *
-from impairments import *
-from phase_bal import *
-from phase_noise_gen import *
-from quantizer import *
+from .amp_bal import *
+from .conj_fs_iqcorr import *
+from .distortion_2_gen import *
+from .distortion_3_gen import *
+from .iqbal_gen import *
+from .impairments import *
+from .phase_bal import *
+from .phase_noise_gen import *
+from .quantizer import *
diff --git a/gr-channels/python/channels/impairments.py 
b/gr-channels/python/channels/impairments.py
index 3da838a..0cfa52d 100644
--- a/gr-channels/python/channels/impairments.py
+++ b/gr-channels/python/channels/impairments.py
@@ -6,6 +6,7 @@
 # Generated: Thu Aug  1 12:46:10 2013
 ##################################################
 
+from __future__ import absolute_import
 from gnuradio import analog
 from gnuradio import blocks
 from gnuradio import gr
@@ -13,10 +14,10 @@ from gnuradio.filter import firdes
 import math
 
 #Import locally
-from phase_noise_gen import *
-from iqbal_gen import *
-from distortion_2_gen import *
-from distortion_3_gen import *
+from .phase_noise_gen import *
+from .iqbal_gen import *
+from .distortion_2_gen import *
+from .distortion_3_gen import *
 
 class impairments(gr.hier_block2):
 
diff --git a/gr-digital/python/digital/__init__.py 
b/gr-digital/python/digital/__init__.py
index 79b7406..44f9893 100644
--- a/gr-digital/python/digital/__init__.py
+++ b/gr-digital/python/digital/__init__.py
@@ -21,6 +21,7 @@
 '''
 Blocks and utilities for digital modulation and demodulation.
 '''
+from __future__ import absolute_import
 
 # The presence of this file turns this directory into a Python package
 
@@ -32,28 +33,28 @@ except ImportError:
     dirname, filename = os.path.split(os.path.abspath(__file__))
     __path__.append(os.path.join(dirname, "..", "..", "swig"))
     from digital_swig import *
-from psk import *
-from qam import *
-from qamlike import *
-from bpsk import *
-from qpsk import *
-from gmsk import *
-from gfsk import *
-from cpm import *
-from pkt import *
-from crc import *
-from modulation_utils import *
-from ofdm import *
-from ofdm_receiver import *
-from ofdm_sync_fixed import *
-from ofdm_sync_ml import *
-from ofdm_sync_pnac import *
-from ofdm_sync_pn import *
-from ofdm_txrx import ofdm_tx, ofdm_rx
-from soft_dec_lut_gen import *
-from psk_constellations import *
-from qam_constellations import *
-from constellation_map_generator import *
+from .psk import *
+from .qam import *
+from .qamlike import *
+from .bpsk import *
+from .qpsk import *
+from .gmsk import *
+from .gfsk import *
+from .cpm import *
+from .pkt import *
+from .crc import *
+from .modulation_utils import *
+from .ofdm import *
+from .ofdm_receiver import *
+from .ofdm_sync_fixed import *
+from .ofdm_sync_ml import *
+from .ofdm_sync_pnac import *
+from .ofdm_sync_pn import *
+from .ofdm_txrx import ofdm_tx, ofdm_rx
+from .soft_dec_lut_gen import *
+from .psk_constellations import *
+from .qam_constellations import *
+from .constellation_map_generator import *
 
-import packet_utils
-import ofdm_packet_utils
+from . import packet_utils
+from . import ofdm_packet_utils
diff --git a/gr-digital/python/digital/bpsk.py 
b/gr-digital/python/digital/bpsk.py
index 2ecaac3..b3a1a15 100644
--- a/gr-digital/python/digital/bpsk.py
+++ b/gr-digital/python/digital/bpsk.py
@@ -22,6 +22,7 @@
 """
 BPSK modulation and demodulation.
 """
+from __future__ import absolute_import
 
 from math import pi, log
 from cmath import exp
@@ -30,7 +31,7 @@ from gnuradio import gr
 from gnuradio.digital.generic_mod_demod import generic_mod, generic_demod
 from gnuradio.digital.generic_mod_demod import shared_mod_args, 
shared_demod_args
 import digital_swig
-import modulation_utils
+from . import modulation_utils
 
 # /////////////////////////////////////////////////////////////////////////////
 #                           BPSK constellation
diff --git a/gr-digital/python/digital/cpm.py b/gr-digital/python/digital/cpm.py
index 6db597d..8a2caab 100644
--- a/gr-digital/python/digital/cpm.py
+++ b/gr-digital/python/digital/cpm.py
@@ -23,6 +23,7 @@
 #
 
 from __future__ import print_function
+from __future__ import absolute_import
 
 # See gnuradio-examples/python/digital for examples
 
@@ -33,7 +34,7 @@ from math import pi
 import numpy
 
 import digital_swig
-import modulation_utils
+from . import modulation_utils
 
 # default values (used in __init__ and add_options)
 _def_samples_per_symbol = 2
diff --git a/gr-digital/python/digital/generic_mod_demod.py 
b/gr-digital/python/digital/generic_mod_demod.py
index 9069ba9..402a1f0 100644
--- a/gr-digital/python/digital/generic_mod_demod.py
+++ b/gr-digital/python/digital/generic_mod_demod.py
@@ -26,10 +26,11 @@ from __future__ import print_function
 """
 Generic modulation and demodulation.
 """
+from __future__ import absolute_import
 
 from gnuradio import gr
-from modulation_utils import extract_kwargs_from_options_for_class
-from utils import mod_codes
+from .modulation_utils import extract_kwargs_from_options_for_class
+from .utils import mod_codes
 import digital_swig as digital
 import math
 
diff --git a/gr-digital/python/digital/gfsk.py 
b/gr-digital/python/digital/gfsk.py
index 813f37d..3ececa5 100644
--- a/gr-digital/python/digital/gfsk.py
+++ b/gr-digital/python/digital/gfsk.py
@@ -23,13 +23,14 @@
 #
 
 from __future__ import print_function
+from __future__ import absolute_import
 
 # See gnuradio-examples/python/digital for examples
 
 from gnuradio import gr
 from gnuradio import analog
 from gnuradio import blocks
-import modulation_utils
+from . import modulation_utils
 import digital_swig as digital
 from math import pi
 import numpy
diff --git a/gr-digital/python/digital/gmsk.py 
b/gr-digital/python/digital/gmsk.py
index c22ecf1..c617654 100644
--- a/gr-digital/python/digital/gmsk.py
+++ b/gr-digital/python/digital/gmsk.py
@@ -23,6 +23,7 @@
 #
 
 from __future__ import print_function
+from __future__ import absolute_import
 
 # See gnuradio-examples/python/digital for examples
 
@@ -33,7 +34,7 @@ import inspect
 import numpy
 
 from gnuradio import gr, blocks, analog, filter
-import modulation_utils
+from . import modulation_utils
 import digital_swig as digital
 
 # default values (used in __init__ and add_options)
diff --git a/gr-digital/python/digital/ofdm.py 
b/gr-digital/python/digital/ofdm.py
index 42ab90d..e1ec452 100644
--- a/gr-digital/python/digital/ofdm.py
+++ b/gr-digital/python/digital/ofdm.py
@@ -21,15 +21,16 @@
 #
 
 from __future__ import print_function
+from __future__ import absolute_import
 
 import math
 from gnuradio import gr, fft
 from gnuradio import blocks
 import digital_swig as digital
-import ofdm_packet_utils
-from ofdm_receiver import ofdm_receiver
+from . import ofdm_packet_utils
+from .ofdm_receiver import ofdm_receiver
 import gnuradio.gr.gr_threading as _threading
-import psk, qam
+from . import psk, qam
 
 # /////////////////////////////////////////////////////////////////////////////
 #                   mod/demod with packets as i/o
diff --git a/gr-digital/python/digital/ofdm_packet_utils.py 
b/gr-digital/python/digital/ofdm_packet_utils.py
index 4e354b7..08ca761 100644
--- a/gr-digital/python/digital/ofdm_packet_utils.py
+++ b/gr-digital/python/digital/ofdm_packet_utils.py
@@ -20,11 +20,12 @@
 #
 
 from __future__ import print_function
+from __future__ import absolute_import
 
 import struct
 import numpy
 from gnuradio import gru
-import crc
+from . import crc
 
 def conv_packed_binary_string_to_1_0_string(s):
     """
diff --git a/gr-digital/python/digital/ofdm_receiver.py 
b/gr-digital/python/digital/ofdm_receiver.py
index 27f8d4d..9aceacc 100644
--- a/gr-digital/python/digital/ofdm_receiver.py
+++ b/gr-digital/python/digital/ofdm_receiver.py
@@ -20,6 +20,7 @@
 # Boston, MA 02110-1301, USA.
 #
 
+from __future__ import absolute_import
 import math
 from numpy import fft
 from gnuradio import fft as gr_fft
@@ -29,10 +30,10 @@ from gnuradio import blocks
 from gnuradio import filter
 
 import digital_swig as digital
-from ofdm_sync_pn import ofdm_sync_pn
-from ofdm_sync_fixed import ofdm_sync_fixed
-from ofdm_sync_pnac import ofdm_sync_pnac
-from ofdm_sync_ml import ofdm_sync_ml
+from .ofdm_sync_pn import ofdm_sync_pn
+from .ofdm_sync_fixed import ofdm_sync_fixed
+from .ofdm_sync_pnac import ofdm_sync_pnac
+from .ofdm_sync_ml import ofdm_sync_ml
 
 try:
     from gnuradio import filter
diff --git a/gr-digital/python/digital/ofdm_txrx.py 
b/gr-digital/python/digital/ofdm_txrx.py
index 026f2bd..fcb6e72 100644
--- a/gr-digital/python/digital/ofdm_txrx.py
+++ b/gr-digital/python/digital/ofdm_txrx.py
@@ -26,6 +26,7 @@ to form an OFDM Tx/Rx--simply use these.
 """
 
 from __future__ import print_function
+from __future__ import absolute_import
 
 # Reminder: All frequency-domain stuff is in shifted form, i.e. DC carrier
 # in the middle!
@@ -33,7 +34,7 @@ from __future__ import print_function
 import numpy
 from gnuradio import gr
 import digital_swig as digital
-from utils import tagged_streams
+from .utils import tagged_streams
 
 try:
     # This will work when feature #505 is added.
diff --git a/gr-digital/python/digital/packet_utils.py 
b/gr-digital/python/digital/packet_utils.py
index 2a6859b..118d4e5 100644
--- a/gr-digital/python/digital/packet_utils.py
+++ b/gr-digital/python/digital/packet_utils.py
@@ -20,11 +20,12 @@
 #
 
 from __future__ import print_function
+from __future__ import absolute_import
 
 import struct
 import numpy
 from gnuradio import gru
-import crc
+from . import crc
 
 def conv_packed_binary_string_to_1_0_string(s):
     """
diff --git a/gr-digital/python/digital/pkt.py b/gr-digital/python/digital/pkt.py
index 843b43f..c9aaf44 100644
--- a/gr-digital/python/digital/pkt.py
+++ b/gr-digital/python/digital/pkt.py
@@ -20,11 +20,12 @@
 #
 
 from __future__ import print_function
+from __future__ import absolute_import
 
 from math import pi
 from gnuradio import gr
 import gnuradio.gr.gr_threading as _threading
-import packet_utils
+from . import packet_utils
 import digital_swig as digital
 
 try:
diff --git a/gr-digital/python/digital/psk.py b/gr-digital/python/digital/psk.py
index d7ec4c9..2de367c 100644
--- a/gr-digital/python/digital/psk.py
+++ b/gr-digital/python/digital/psk.py
@@ -22,15 +22,16 @@
 """
 PSK modulation and demodulation.
 """
+from __future__ import absolute_import
 
 from math import pi, log
 from cmath import exp
 
 import digital_swig
-import modulation_utils
-from utils import mod_codes, gray_code
-from generic_mod_demod import generic_mod, generic_demod
-from generic_mod_demod import shared_mod_args, shared_demod_args
+from . import modulation_utils
+from .utils import mod_codes, gray_code
+from .generic_mod_demod import generic_mod, generic_demod
+from .generic_mod_demod import shared_mod_args, shared_demod_args
 
 # Default number of points in constellation.
 _def_constellation_points = 4
diff --git a/gr-digital/python/digital/psk_constellations.py 
b/gr-digital/python/digital/psk_constellations.py
index d2db4e8..7287e48 100755
--- a/gr-digital/python/digital/psk_constellations.py
+++ b/gr-digital/python/digital/psk_constellations.py
@@ -20,8 +20,9 @@
 # Boston, MA 02110-1301, USA.
 #
 
+from __future__ import absolute_import
 import numpy
-from constellation_map_generator import *
+from .constellation_map_generator import *
 
 '''
 Note on the naming scheme. Each constellation is named using a prefix
diff --git a/gr-digital/python/digital/qa_constellation_receiver.py 
b/gr-digital/python/digital/qa_constellation_receiver.py
index 9565c70..9ef416b 100755
--- a/gr-digital/python/digital/qa_constellation_receiver.py
+++ b/gr-digital/python/digital/qa_constellation_receiver.py
@@ -20,6 +20,8 @@
 # Boston, MA 02110-1301, USA.
 # 
 
+from __future__ import print_function
+from __future__ import absolute_import
 import random
 import math
 
@@ -30,7 +32,7 @@ from gnuradio.digital.utils import mod_codes, alignment
 from gnuradio.digital import packet_utils
 from gnuradio.digital.generic_mod_demod import generic_mod, generic_demod
 
-from qa_constellation import tested_constellations, twod_constell
+from .qa_constellation import tested_constellations, twod_constell
 
 # Set a seed so that if errors turn up they are reproducible.
 SEED = 1239
diff --git a/gr-digital/python/digital/qa_probe_density.py 
b/gr-digital/python/digital/qa_probe_density.py
index 752d95d..68cfdaf 100755
--- a/gr-digital/python/digital/qa_probe_density.py
+++ b/gr-digital/python/digital/qa_probe_density.py
@@ -20,6 +20,7 @@
 # Boston, MA 02110-1301, USA.
 # 
 
+from __future__ import print_function
 from gnuradio import gr, gr_unittest, digital, blocks
 
 class test_probe_density(gr_unittest.TestCase):
@@ -62,7 +63,7 @@ class test_probe_density(gr_unittest.TestCase):
         self.tb.run()
 
         result_data = op.density()
-        print result_data
+        print(result_data)
         self.assertAlmostEqual(expected_data, result_data, 5)
 
 if __name__ == '__main__':
diff --git a/gr-digital/python/digital/qam.py b/gr-digital/python/digital/qam.py
index 55a82a9..e2f9a2a 100644
--- a/gr-digital/python/digital/qam.py
+++ b/gr-digital/python/digital/qam.py
@@ -22,15 +22,16 @@
 """
 QAM modulation and demodulation.
 """
+from __future__ import absolute_import
 
 from math import pi, sqrt, log
 
 from gnuradio import gr
-from generic_mod_demod import generic_mod, generic_demod
-from generic_mod_demod import shared_mod_args, shared_demod_args
-from utils.gray_code import gray_code
-from utils import mod_codes
-import modulation_utils
+from .generic_mod_demod import generic_mod, generic_demod
+from .generic_mod_demod import shared_mod_args, shared_demod_args
+from .utils.gray_code import gray_code
+from .utils import mod_codes
+from . import modulation_utils
 import digital_swig as digital
 
 # Default number of points in constellation.
diff --git a/gr-digital/python/digital/qam_constellations.py 
b/gr-digital/python/digital/qam_constellations.py
index ab58916..d26c5ff 100755
--- a/gr-digital/python/digital/qam_constellations.py
+++ b/gr-digital/python/digital/qam_constellations.py
@@ -20,8 +20,9 @@
 # Boston, MA 02110-1301, USA.
 #
 
+from __future__ import absolute_import
 import numpy
-from constellation_map_generator import *
+from .constellation_map_generator import *
 
 '''
 Note on the naming scheme. Each constellation is named using a prefix
diff --git a/gr-digital/python/digital/qamlike.py 
b/gr-digital/python/digital/qamlike.py
index 2f8c855..7186dea 100644
--- a/gr-digital/python/digital/qamlike.py
+++ b/gr-digital/python/digital/qamlike.py
@@ -21,9 +21,10 @@
 """
 This file contains constellations that are similar to QAM, but are not perfect 
squares.
 """
+from __future__ import absolute_import
 
 import digital_swig
-from qam import large_ampls_to_corners_mapping
+from .qam import large_ampls_to_corners_mapping
 
 def qam32_holeinside_constellation(large_ampls_to_corners=False):
     # First make constellation for one quadrant.
diff --git a/gr-digital/python/digital/qpsk.py 
b/gr-digital/python/digital/qpsk.py
index c5230ef..810f211 100644
--- a/gr-digital/python/digital/qpsk.py
+++ b/gr-digital/python/digital/qpsk.py
@@ -24,13 +24,14 @@ QPSK modulation.
 
 Demodulation is not included since the generic_mod_demod
 """
+from __future__ import absolute_import
 
 from gnuradio import gr
 from gnuradio.digital.generic_mod_demod import generic_mod, generic_demod
 from gnuradio.digital.generic_mod_demod import shared_mod_args, 
shared_demod_args
-from utils import mod_codes
+from .utils import mod_codes
 import digital_swig as digital
-import modulation_utils
+from . import modulation_utils
 
 # The default encoding (e.g. gray-code, set-partition)
 _def_mod_code = mod_codes.GRAY_CODE
diff --git a/gr-digital/python/digital/test_soft_decisions.py 
b/gr-digital/python/digital/test_soft_decisions.py
index 21b529a..ea01a55 100755
--- a/gr-digital/python/digital/test_soft_decisions.py
+++ b/gr-digital/python/digital/test_soft_decisions.py
@@ -21,12 +21,13 @@
 #
 
 from __future__ import print_function
+from __future__ import absolute_import
 
 import numpy, pylab, sys
 from gnuradio import digital
-from soft_dec_lut_gen import *
-from psk_constellations import *
-from qam_constellations import *
+from .soft_dec_lut_gen import *
+from .psk_constellations import *
+from .qam_constellations import *
 
 def test_qpsk(i, sample, prec):
     qpsk_const_list = [psk_4_0, psk_4_1, psk_4_2, psk_4_3,
diff --git a/gr-digital/python/digital/utils/tagged_streams.py 
b/gr-digital/python/digital/utils/tagged_streams.py
index ca68af2..f7f477b 100644
--- a/gr-digital/python/digital/utils/tagged_streams.py
+++ b/gr-digital/python/digital/utils/tagged_streams.py
@@ -22,6 +22,7 @@
 
 # DEPRECATED -- Marked for removal in 3.8
 
+from __future__ import print_function
 from gnuradio import gr
 import pmt
 
diff --git a/gr-dtv/python/dtv/__init__.py b/gr-dtv/python/dtv/__init__.py
index 8d2b8bf..57b737b 100644
--- a/gr-dtv/python/dtv/__init__.py
+++ b/gr-dtv/python/dtv/__init__.py
@@ -24,6 +24,7 @@
 '''
 Blocks and utilities for digital TV module.
 '''
+from __future__ import absolute_import
 import os
 
 try:
@@ -34,4 +35,4 @@ except ImportError:
     from dtv_swig import *
 
 # Import pure python code here
-from atsc_rx import *
+from .atsc_rx import *
diff --git a/gr-dtv/python/dtv/atsc_rx.py b/gr-dtv/python/dtv/atsc_rx.py
index e2e751e..ab83aaf 100644
--- a/gr-dtv/python/dtv/atsc_rx.py
+++ b/gr-dtv/python/dtv/atsc_rx.py
@@ -19,8 +19,9 @@
 # the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
 # Boston, MA 02111-1307, USA.
 
+from __future__ import absolute_import
 from gnuradio import gr, filter, analog
-from atsc_rx_filter import *
+from .atsc_rx_filter import *
 
 class atsc_rx(gr.hier_block2):
     def __init__(self, input_rate, sps):
diff --git a/gr-fec/python/fec/LDPC/Generate_LDPC_matrix.py 
b/gr-fec/python/fec/LDPC/Generate_LDPC_matrix.py
index 62554dc..582bf85 100644
--- a/gr-fec/python/fec/LDPC/Generate_LDPC_matrix.py
+++ b/gr-fec/python/fec/LDPC/Generate_LDPC_matrix.py
@@ -21,8 +21,9 @@
 #
 
 from __future__ import print_function
+from __future__ import absolute_import
 
-from Generate_LDPC_matrix_functions import *
+from .Generate_LDPC_matrix_functions import *
 
 # This is an example of how to generate a parity check matrix for
 # use with the LDPC Richardson Urbanke encoder. A significant amount
diff --git a/gr-fec/python/fec/LDPC/__init__.py 
b/gr-fec/python/fec/LDPC/__init__.py
index 173171a..ac7ce93 100644
--- a/gr-fec/python/fec/LDPC/__init__.py
+++ b/gr-fec/python/fec/LDPC/__init__.py
@@ -1,3 +1,4 @@
+from __future__ import absolute_import
 #
 # Copyright 2015 Free Software Foundation, Inc.
 #
@@ -19,4 +20,4 @@
 # Boston, MA 02110-1301, USA.
 #
 
-from Generate_LDPC_matrix_functions import *
+from .Generate_LDPC_matrix_functions import *
diff --git a/gr-fec/python/fec/__init__.py b/gr-fec/python/fec/__init__.py
index 6c82232..d2b3d6d 100644
--- a/gr-fec/python/fec/__init__.py
+++ b/gr-fec/python/fec/__init__.py
@@ -22,6 +22,7 @@
 '''
 Blocks for forward error correction.
 '''
+from __future__ import absolute_import
 
 try:
     from fec_swig import *
@@ -31,17 +32,17 @@ except ImportError:
     __path__.append(os.path.join(dirname, "..", "..", "swig"))
     from fec_swig import *
 
-from bitflip import *
-from extended_encoder import extended_encoder
-from extended_decoder import extended_decoder
-from threaded_encoder import threaded_encoder
-from threaded_decoder import threaded_decoder
-from capillary_threaded_decoder import capillary_threaded_decoder
-from capillary_threaded_encoder import capillary_threaded_encoder
-from extended_async_encoder import extended_async_encoder
-from extended_tagged_encoder import extended_tagged_encoder
-from extended_tagged_decoder import extended_tagged_decoder
+from .bitflip import *
+from .extended_encoder import extended_encoder
+from .extended_decoder import extended_decoder
+from .threaded_encoder import threaded_encoder
+from .threaded_decoder import threaded_decoder
+from .capillary_threaded_decoder import capillary_threaded_decoder
+from .capillary_threaded_encoder import capillary_threaded_encoder
+from .extended_async_encoder import extended_async_encoder
+from .extended_tagged_encoder import extended_tagged_encoder
+from .extended_tagged_decoder import extended_tagged_decoder
 
 
-from fec_test import fec_test
-from bercurve_generator import bercurve_generator
+from .fec_test import fec_test
+from .bercurve_generator import bercurve_generator
diff --git a/gr-fec/python/fec/_qa_helper.py b/gr-fec/python/fec/_qa_helper.py
index 358671b..352783f 100755
--- a/gr-fec/python/fec/_qa_helper.py
+++ b/gr-fec/python/fec/_qa_helper.py
@@ -21,13 +21,14 @@
 #
 
 from __future__ import print_function
+from __future__ import absolute_import
 
 from gnuradio import blocks
 from gnuradio import gr
 import sys, numpy
 
-from extended_encoder import extended_encoder
-from extended_decoder import extended_decoder
+from .extended_encoder import extended_encoder
+from .extended_decoder import extended_decoder
 
 class map_bb(gr.sync_block):
     def __init__(self, bitmap):
diff --git a/gr-fec/python/fec/bercurve_generator.py 
b/gr-fec/python/fec/bercurve_generator.py
index 3221a68..c59ea0f 100644
--- a/gr-fec/python/fec/bercurve_generator.py
+++ b/gr-fec/python/fec/bercurve_generator.py
@@ -20,10 +20,11 @@
 # Boston, MA 02110-1301, USA.
 #
 
+from __future__ import absolute_import
 from gnuradio import gr, blocks
 import numpy
 
-from fec_test import fec_test
+from .fec_test import fec_test
 
 class bercurve_generator(gr.hier_block2):
 
diff --git a/gr-fec/python/fec/extended_async_encoder.py 
b/gr-fec/python/fec/extended_async_encoder.py
index fcd8d0c..1531e7c 100644
--- a/gr-fec/python/fec/extended_async_encoder.py
+++ b/gr-fec/python/fec/extended_async_encoder.py
@@ -21,10 +21,11 @@
 #
 
 from __future__ import print_function
+from __future__ import absolute_import
 
 from gnuradio import gr
 import fec_swig as fec
-from bitflip import read_bitlist
+from .bitflip import read_bitlist
 import weakref
 
 class extended_async_encoder(gr.hier_block2):
diff --git a/gr-fec/python/fec/extended_decoder.py 
b/gr-fec/python/fec/extended_decoder.py
index 502fae5..2221d87 100644
--- a/gr-fec/python/fec/extended_decoder.py
+++ b/gr-fec/python/fec/extended_decoder.py
@@ -21,19 +21,20 @@
 #
 
 from __future__ import print_function
+from __future__ import absolute_import
 
 from gnuradio import gr, blocks
 import fec_swig as fec
-from bitflip import *
+from .bitflip import *
 import sys
 
-if sys.modules.has_key("gnuradio.digital"):
+if "gnuradio.digital" in sys.modules:
     digital = sys.modules["gnuradio.digital"]
 else:
     from gnuradio import digital
 
-from threaded_decoder import threaded_decoder
-from capillary_threaded_decoder import capillary_threaded_decoder
+from .threaded_decoder import threaded_decoder
+from .capillary_threaded_decoder import capillary_threaded_decoder
 
 class extended_decoder(gr.hier_block2):
 
diff --git a/gr-fec/python/fec/extended_encoder.py 
b/gr-fec/python/fec/extended_encoder.py
index 1c6da0e..83a3ccb 100644
--- a/gr-fec/python/fec/extended_encoder.py
+++ b/gr-fec/python/fec/extended_encoder.py
@@ -20,12 +20,13 @@
 # Boston, MA 02110-1301, USA.
 #
 
+from __future__ import absolute_import
 from gnuradio import gr, blocks
 
 import fec_swig as fec
-from threaded_encoder import threaded_encoder
-from capillary_threaded_encoder import capillary_threaded_encoder
-from bitflip import read_bitlist
+from .threaded_encoder import threaded_encoder
+from .capillary_threaded_encoder import capillary_threaded_encoder
+from .bitflip import read_bitlist
 
 class extended_encoder(gr.hier_block2):
     def __init__(self, encoder_obj_list, threading, puncpat=None):
diff --git a/gr-fec/python/fec/extended_tagged_decoder.py 
b/gr-fec/python/fec/extended_tagged_decoder.py
index ee31097..63e8dfe 100644
--- a/gr-fec/python/fec/extended_tagged_decoder.py
+++ b/gr-fec/python/fec/extended_tagged_decoder.py
@@ -21,13 +21,14 @@
 #
 
 from __future__ import print_function
+from __future__ import absolute_import
 
 from gnuradio import gr, blocks
 import fec_swig as fec
-from bitflip import *
+from .bitflip import *
 import sys
 
-if sys.modules.has_key("gnuradio.digital"):
+if "gnuradio.digital" in sys.modules:
     digital = sys.modules["gnuradio.digital"]
 else:
     from gnuradio import digital
diff --git a/gr-fec/python/fec/extended_tagged_encoder.py 
b/gr-fec/python/fec/extended_tagged_encoder.py
index d3cf1d8..345dd69 100644
--- a/gr-fec/python/fec/extended_tagged_encoder.py
+++ b/gr-fec/python/fec/extended_tagged_encoder.py
@@ -20,10 +20,11 @@
 # Boston, MA 02110-1301, USA.
 #
 
+from __future__ import absolute_import
 from gnuradio import gr, blocks
 
 import fec_swig as fec
-from bitflip import read_bitlist
+from .bitflip import read_bitlist
 
 class extended_tagged_encoder(gr.hier_block2):
     def __init__(self, encoder_obj_list, puncpat=None, lentagname=None, 
mtu=1500):
diff --git a/gr-fec/python/fec/fec_test.py b/gr-fec/python/fec/fec_test.py
index 6466a0b..7cecd7e 100644
--- a/gr-fec/python/fec/fec_test.py
+++ b/gr-fec/python/fec/fec_test.py
@@ -20,18 +20,19 @@
 # Boston, MA 02110-1301, USA.
 #
 
+from __future__ import absolute_import
 from gnuradio.fec.bitflip import read_bitlist
 from gnuradio import gr, blocks, analog
 import math
 import sys
 
-if sys.modules.has_key("gnuradio.digital"):
+if "gnuradio.digital" in sys.modules:
     digital = sys.modules["gnuradio.digital"]
 else:
     from gnuradio import digital
 
-from extended_encoder import extended_encoder
-from extended_decoder import extended_decoder
+from .extended_encoder import extended_encoder
+from .extended_decoder import extended_decoder
 
 class fec_test(gr.hier_block2):
 
diff --git a/gr-fec/python/fec/polar/__init__.py 
b/gr-fec/python/fec/polar/__init__.py
index ce1b145..f57e2f7 100644
--- a/gr-fec/python/fec/polar/__init__.py
+++ b/gr-fec/python/fec/polar/__init__.py
@@ -21,9 +21,11 @@
 
 # turn this folder into a Python module
 
-import channel_construction as cc
-from channel_construction_bec import bhattacharyya_bounds
-from helper_functions import is_power_of_two
+from __future__ import print_function
+from __future__ import absolute_import
+from . import channel_construction as cc
+from .channel_construction_bec import bhattacharyya_bounds
+from .helper_functions import is_power_of_two
 
 
 CHANNEL_TYPE_AWGN = 'AWGN'
diff --git a/gr-fec/python/fec/polar/channel_construction.py 
b/gr-fec/python/fec/polar/channel_construction.py
index 4a4aa57..b60a92a 100644
--- a/gr-fec/python/fec/polar/channel_construction.py
+++ b/gr-fec/python/fec/polar/channel_construction.py
@@ -24,13 +24,14 @@ from __future__ import print_function
 [0] Erdal Arikan: 'Channel Polarization: A Method for Constructing 
Capacity-Achieving Codes for Symmetric Binary-Input Memoryless Channels', 2009
 foundational paper for polar codes.
 '''
+from __future__ import absolute_import
 
 
-from channel_construction_bec import calculate_bec_channel_capacities
-from channel_construction_bec import design_snr_to_bec_eta
-from channel_construction_bec import bhattacharyya_bounds
-from channel_construction_awgn import tal_vardy_tpm_algorithm
-from helper_functions import *
+from .channel_construction_bec import calculate_bec_channel_capacities
+from .channel_construction_bec import design_snr_to_bec_eta
+from .channel_construction_bec import bhattacharyya_bounds
+from .channel_construction_awgn import tal_vardy_tpm_algorithm
+from .helper_functions import *
 
 
 Z_PARAM_FIRST_HEADER_LINE = "Bhattacharyya parameters (Z-parameters) for a 
polar code"
diff --git a/gr-fec/python/fec/polar/channel_construction_awgn.py 
b/gr-fec/python/fec/polar/channel_construction_awgn.py
index 5cb2752..c39adc6 100755
--- a/gr-fec/python/fec/polar/channel_construction_awgn.py
+++ b/gr-fec/python/fec/polar/channel_construction_awgn.py
@@ -28,12 +28,13 @@ for an in-depth description of a widely used algorithm for 
channel construction.
 [2] Harish Vangala, Emanuele Viterbo, Yi Hong: 'A Comparative Study of Polar 
Code Constructions for the AWGN Channel', 2015
 for an overview of different approaches
 '''
+from __future__ import absolute_import
 
 
 from scipy.optimize import fsolve
 from scipy.special import erfc
-from helper_functions import *
-from channel_construction_bec import bhattacharyya_bounds
+from .helper_functions import *
+from .channel_construction_bec import bhattacharyya_bounds
 
 
 def solver_equation(val, s):
diff --git a/gr-fec/python/fec/polar/channel_construction_bec.py 
b/gr-fec/python/fec/polar/channel_construction_bec.py
index d6b1636..a04a15a 100644
--- a/gr-fec/python/fec/polar/channel_construction_bec.py
+++ b/gr-fec/python/fec/polar/channel_construction_bec.py
@@ -19,9 +19,10 @@
 #
 
 from __future__ import print_function
+from __future__ import absolute_import
 
 import numpy as np
-import helper_functions as hf
+from . import helper_functions as hf
 
 
 def bec_channel(eta):
diff --git a/gr-fec/python/fec/polar/common.py 
b/gr-fec/python/fec/polar/common.py
index 09c9a8a..22c8512 100644
--- a/gr-fec/python/fec/polar/common.py
+++ b/gr-fec/python/fec/polar/common.py
@@ -19,10 +19,11 @@
 #
 
 from __future__ import print_function
+from __future__ import absolute_import
 
 
 import numpy as np
-from helper_functions import *
+from .helper_functions import *
 
 '''
 PolarCommon holds value checks and common initializer code for both Encoder 
and Decoder.
diff --git a/gr-fec/python/fec/polar/decoder.py 
b/gr-fec/python/fec/polar/decoder.py
index 2f39779..35eecf8 100644
--- a/gr-fec/python/fec/polar/decoder.py
+++ b/gr-fec/python/fec/polar/decoder.py
@@ -19,12 +19,13 @@
 #
 
 from __future__ import print_function
+from __future__ import absolute_import
 
 import numpy as np
-from common import PolarCommon
+from .common import PolarCommon
 
 # for dev
-from encoder import PolarEncoder
+from .encoder import PolarEncoder
 from matplotlib import pyplot as plt
 
 
diff --git a/gr-fec/python/fec/polar/encoder.py 
b/gr-fec/python/fec/polar/encoder.py
index 73ed2a8..4b88ba9 100644
--- a/gr-fec/python/fec/polar/encoder.py
+++ b/gr-fec/python/fec/polar/encoder.py
@@ -19,10 +19,11 @@
 #
 
 from __future__ import print_function
+from __future__ import absolute_import
 
 import numpy as np
-from common import PolarCommon
-import helper_functions as hf
+from .common import PolarCommon
+from . import helper_functions as hf
 
 
 class PolarEncoder(PolarCommon):
diff --git a/gr-fec/python/fec/polar/testbed.py 
b/gr-fec/python/fec/polar/testbed.py
index 15f86c1..645bf08 100755
--- a/gr-fec/python/fec/polar/testbed.py
+++ b/gr-fec/python/fec/polar/testbed.py
@@ -19,12 +19,13 @@
 #
 
 from __future__ import print_function
+from __future__ import absolute_import
 
 
-from encoder import PolarEncoder
-from decoder import PolarDecoder
-import channel_construction as cc
-from helper_functions import *
+from .encoder import PolarEncoder
+from .decoder import PolarDecoder
+from . import channel_construction as cc
+from .helper_functions import *
 
 import matplotlib.pyplot as plt
 
diff --git a/gr-fec/python/fec/qa_fecapi_cc.py 
b/gr-fec/python/fec/qa_fecapi_cc.py
index bbd5001..e401b80 100644
--- a/gr-fec/python/fec/qa_fecapi_cc.py
+++ b/gr-fec/python/fec/qa_fecapi_cc.py
@@ -20,12 +20,13 @@
 # Boston, MA 02110-1301, USA.
 #
 
+from __future__ import absolute_import
 from gnuradio import gr, gr_unittest
 import fec_swig as fec
-from _qa_helper import _qa_helper
+from ._qa_helper import _qa_helper
 
-from extended_encoder import extended_encoder
-from extended_decoder import extended_decoder
+from .extended_encoder import extended_encoder
+from .extended_decoder import extended_decoder
 
 class test_fecapi_cc(gr_unittest.TestCase):
 
diff --git a/gr-fec/python/fec/qa_fecapi_dummy.py 
b/gr-fec/python/fec/qa_fecapi_dummy.py
index 9471c71..ca36385 100644
--- a/gr-fec/python/fec/qa_fecapi_dummy.py
+++ b/gr-fec/python/fec/qa_fecapi_dummy.py
@@ -20,13 +20,14 @@
 # Boston, MA 02110-1301, USA.
 #
 
+from __future__ import absolute_import
 from gnuradio import gr, gr_unittest, blocks
 import fec_swig as fec
-from _qa_helper import _qa_helper
+from ._qa_helper import _qa_helper
 import numpy as np
 
-from extended_encoder import extended_encoder
-from extended_decoder import extended_decoder
+from .extended_encoder import extended_encoder
+from .extended_decoder import extended_decoder
 
 class test_fecapi_dummy(gr_unittest.TestCase):
 
diff --git a/gr-fec/python/fec/qa_fecapi_ldpc.py 
b/gr-fec/python/fec/qa_fecapi_ldpc.py
index b45ce0e..c936257 100644
--- a/gr-fec/python/fec/qa_fecapi_ldpc.py
+++ b/gr-fec/python/fec/qa_fecapi_ldpc.py
@@ -20,12 +20,13 @@
 # Boston, MA 02110-1301, USA.
 #
 
+from __future__ import absolute_import
 from gnuradio import gr, gr_unittest
 import fec_swig as fec
-from _qa_helper import _qa_helper
+from ._qa_helper import _qa_helper
 
-from extended_encoder import extended_encoder
-from extended_decoder import extended_decoder
+from .extended_encoder import extended_encoder
+from .extended_decoder import extended_decoder
 
 import os
 
diff --git a/gr-fec/python/fec/qa_fecapi_repetition.py 
b/gr-fec/python/fec/qa_fecapi_repetition.py
index 7998d61..97b5d1e 100644
--- a/gr-fec/python/fec/qa_fecapi_repetition.py
+++ b/gr-fec/python/fec/qa_fecapi_repetition.py
@@ -20,12 +20,13 @@
 # Boston, MA 02110-1301, USA.
 #
 
+from __future__ import absolute_import
 from gnuradio import gr, gr_unittest
 import fec_swig as fec
-from _qa_helper import _qa_helper
+from ._qa_helper import _qa_helper
 
-from extended_encoder import extended_encoder
-from extended_decoder import extended_decoder
+from .extended_encoder import extended_encoder
+from .extended_decoder import extended_decoder
 
 class test_fecapi_repetition(gr_unittest.TestCase):
 
diff --git a/gr-fec/python/fec/qa_polar_decoder_sc.py 
b/gr-fec/python/fec/qa_polar_decoder_sc.py
index b5ab031..a391ffb 100644
--- a/gr-fec/python/fec/qa_polar_decoder_sc.py
+++ b/gr-fec/python/fec/qa_polar_decoder_sc.py
@@ -21,14 +21,15 @@
 #
 
 from __future__ import print_function
+from __future__ import absolute_import
 
 from gnuradio import gr, gr_unittest, blocks
 import fec_swig as fec
 
 import numpy as np
-from extended_decoder import extended_decoder
-from polar.encoder import PolarEncoder
-import polar.channel_construction as cc
+from .extended_decoder import extended_decoder
+from .polar.encoder import PolarEncoder
+from . import polar.channel_construction as cc
 
 # import os
 # print('PID:', os.getpid())
diff --git a/gr-fec/python/fec/qa_polar_decoder_sc_list.py 
b/gr-fec/python/fec/qa_polar_decoder_sc_list.py
index baa5594..a2a85eb 100644
--- a/gr-fec/python/fec/qa_polar_decoder_sc_list.py
+++ b/gr-fec/python/fec/qa_polar_decoder_sc_list.py
@@ -21,14 +21,15 @@
 #
 
 from __future__ import print_function
+from __future__ import absolute_import
 
 from gnuradio import gr, gr_unittest, blocks
 import fec_swig as fec
 import numpy as np
 
-from extended_decoder import extended_decoder
-from polar.encoder import PolarEncoder
-import polar.channel_construction as cc
+from .extended_decoder import extended_decoder
+from .polar.encoder import PolarEncoder
+from . import polar.channel_construction as cc
 
 # import os
 # print('PID:', os.getpid())
diff --git a/gr-fec/python/fec/qa_polar_decoder_sc_systematic.py 
b/gr-fec/python/fec/qa_polar_decoder_sc_systematic.py
index fb2381e..540bb7d 100644
--- a/gr-fec/python/fec/qa_polar_decoder_sc_systematic.py
+++ b/gr-fec/python/fec/qa_polar_decoder_sc_systematic.py
@@ -20,13 +20,14 @@
 # Boston, MA 02110-1301, USA.
 #
 
+from __future__ import absolute_import
 from gnuradio import gr, gr_unittest, blocks
 import fec_swig as fec
 
 import numpy as np
-from extended_decoder import extended_decoder
-from polar.encoder import PolarEncoder
-import polar.channel_construction as cc
+from .extended_decoder import extended_decoder
+from .polar.encoder import PolarEncoder
+from . import polar.channel_construction as cc
 
 # import os
 # print('PID:', os.getpid())
diff --git a/gr-fec/python/fec/qa_polar_encoder.py 
b/gr-fec/python/fec/qa_polar_encoder.py
index d7362b6..6304c30 100644
--- a/gr-fec/python/fec/qa_polar_encoder.py
+++ b/gr-fec/python/fec/qa_polar_encoder.py
@@ -20,13 +20,14 @@
 # Boston, MA 02110-1301, USA.
 #
 
+from __future__ import absolute_import
 from gnuradio import gr, gr_unittest, blocks
 import fec_swig as fec
 import numpy as np
 
-from extended_encoder import extended_encoder
-from polar.encoder import PolarEncoder
-import polar.channel_construction as cc
+from .extended_encoder import extended_encoder
+from .polar.encoder import PolarEncoder
+from . import polar.channel_construction as cc
 
 # import os
 # print('PID:', os.getpid())
diff --git a/gr-fec/python/fec/qa_polar_encoder_systematic.py 
b/gr-fec/python/fec/qa_polar_encoder_systematic.py
index 015a31b..d2869a5 100644
--- a/gr-fec/python/fec/qa_polar_encoder_systematic.py
+++ b/gr-fec/python/fec/qa_polar_encoder_systematic.py
@@ -20,13 +20,14 @@
 # Boston, MA 02110-1301, USA.
 #
 
+from __future__ import absolute_import
 from gnuradio import gr, gr_unittest, blocks
 import fec_swig as fec
 import numpy as np
 
-from extended_encoder import extended_encoder
-from polar.encoder import PolarEncoder
-import polar.channel_construction as cc
+from .extended_encoder import extended_encoder
+from .polar.encoder import PolarEncoder
+from . import polar.channel_construction as cc
 
 # import os
 # print('PID:', os.getpid())
diff --git a/gr-filter/examples/benchmark_filters.py 
b/gr-filter/examples/benchmark_filters.py
index 4da6b9f..a2d3121 100755
--- a/gr-filter/examples/benchmark_filters.py
+++ b/gr-filter/examples/benchmark_filters.py
@@ -20,6 +20,7 @@
 # Boston, MA 02110-1301, USA.
 #
 
+from __future__ import print_function
 import time
 import random
 from argparse import ArgumentParser
@@ -48,8 +49,8 @@ def benchmark(name, creator, dec, ntaps, total_test_size, 
block_size):
     tb.run()
     stop = time.time()
     delta = stop - start
-    print "%16s: taps: %4d  input: %4g, time: %6.3f  taps/sec: %10.4g" % (
-        name, ntaps, total_test_size, delta, ntaps*total_test_size/delta)
+    print("%16s: taps: %4d  input: %4g, time: %6.3f  taps/sec: %10.4g" % (
+        name, ntaps, total_test_size, delta, ntaps*total_test_size/delta))
 
 def main():
     parser = ArgumentParser()
diff --git a/gr-filter/examples/channelize.py b/gr-filter/examples/channelize.py
index e70817e..07f1aed 100755
--- a/gr-filter/examples/channelize.py
+++ b/gr-filter/examples/channelize.py
@@ -20,6 +20,7 @@
 # Boston, MA 02110-1301, USA.
 #
 
+from __future__ import print_function
 from gnuradio import gr
 from gnuradio import blocks
 from gnuradio import filter
@@ -61,9 +62,9 @@ class pfb_top_block(gr.top_block):
 
         # Calculate the number of taps per channel for our own information
         tpc = scipy.ceil(float(len(self._taps)) /  float(self._M))
-        print "Number of taps:     ", len(self._taps)
-        print "Number of channels: ", self._M
-        print "Taps per channel:   ", tpc
+        print("Number of taps:     ", len(self._taps))
+        print("Number of channels: ", self._M)
+        print("Taps per channel:   ", tpc)
 
         # Create a set of signals at different frequencies
         #   freqs lists the frequencies of the signals that get stored
@@ -105,7 +106,7 @@ def main():
     tb.run()
 
     tend = time.time()
-    print "Run time: %f" % (tend - tstart)
+    print("Run time: %f" % (tend - tstart))
 
     if 1:
         fig_in = pylab.figure(1, figsize=(16,9), facecolor="w")
diff --git a/gr-filter/examples/chirp_channelize.py 
b/gr-filter/examples/chirp_channelize.py
index aedd5c4..5c65db5 100755
--- a/gr-filter/examples/chirp_channelize.py
+++ b/gr-filter/examples/chirp_channelize.py
@@ -20,6 +20,7 @@
 # Boston, MA 02110-1301, USA.
 #
 
+from __future__ import print_function
 from gnuradio import gr
 from gnuradio import blocks
 from gnuradio import filter
@@ -60,9 +61,9 @@ class pfb_top_block(gr.top_block):
 
         # Calculate the number of taps per channel for our own information
         tpc = scipy.ceil(float(len(self._taps)) /  float(self._M))
-        print "Number of taps:     ", len(self._taps)
-        print "Number of channels: ", self._M
-        print "Taps per channel:   ", tpc
+        print("Number of taps:     ", len(self._taps))
+        print("Number of channels: ", self._M)
+        print("Taps per channel:   ", tpc)
 
         repeated = True
         if(repeated):
@@ -104,7 +105,7 @@ def main():
     tb.run()
 
     tend = time.time()
-    print "Run time: %f" % (tend - tstart)
+    print("Run time: %f" % (tend - tstart))
 
     if 1:
         fig_in = pylab.figure(1, figsize=(16,9), facecolor="w")
diff --git a/gr-filter/examples/decimate.py b/gr-filter/examples/decimate.py
index 675073a..0946b6d 100755
--- a/gr-filter/examples/decimate.py
+++ b/gr-filter/examples/decimate.py
@@ -20,6 +20,7 @@
 # Boston, MA 02110-1301, USA.
 #
 
+from __future__ import print_function
 from gnuradio import gr
 from gnuradio import blocks
 from gnuradio import filter
@@ -61,9 +62,9 @@ class pfb_top_block(gr.top_block):
 
         # Calculate the number of taps per channel for our own information
         tpc = scipy.ceil(float(len(self._taps)) /  float(self._decim))
-        print "Number of taps:     ", len(self._taps)
-        print "Number of filters:  ", self._decim
-        print "Taps per channel:   ", tpc
+        print("Number of taps:     ", len(self._taps))
+        print("Number of filters:  ", self._decim)
+        print("Taps per channel:   ", tpc)
 
         # Build the input signal source
         # We create a list of freqs, and a sine wave is generated and added to 
the source
@@ -100,7 +101,7 @@ def main():
     tstart = time.time()
     tb.run()
     tend = time.time()
-    print "Run time: %f" % (tend - tstart)
+    print("Run time: %f" % (tend - tstart))
 
     if 1:
         fig1 = pylab.figure(1, figsize=(16,9))
diff --git a/gr-filter/examples/fft_filter_ccc.py 
b/gr-filter/examples/fft_filter_ccc.py
index 92bcc7e..6a32ba0 100755
--- a/gr-filter/examples/fft_filter_ccc.py
+++ b/gr-filter/examples/fft_filter_ccc.py
@@ -20,6 +20,7 @@
 # Boston, MA 02110-1301, USA.
 #
 
+from __future__ import print_function
 from gnuradio import gr, filter
 from gnuradio import analog
 from gnuradio import blocks
@@ -31,13 +32,13 @@ import sys
 try:
     import scipy
 except ImportError:
-    print "Error: could not import scipy (http://www.scipy.org/)"
+    print("Error: could not import scipy (http://www.scipy.org/)")
     sys.exit(1)
 
 try:
     import pylab
 except ImportError:
-    print "Error: could not import pylab (http://matplotlib.sourceforge.net/)"
+    print("Error: could not import pylab (http://matplotlib.sourceforge.net/)")
     sys.exit(1)
 
 class example_fft_filter_ccc(gr.top_block):
@@ -54,7 +55,7 @@ class example_fft_filter_ccc(gr.top_block):
         taps = filter.firdes.complex_band_pass_2(1, self._fs,
                                                  self._bw0, self._bw1,
                                                  self._tw, self._at)
-        print "Num. Taps: ", len(taps)
+        print("Num. Taps: ", len(taps))
 
         self.src  = analog.noise_source_c(analog.GR_GAUSSIAN, 1)
         self.head = blocks.head(gr.sizeof_gr_complex, self._nsamps)
diff --git a/gr-filter/examples/fir_filter_ccc.py 
b/gr-filter/examples/fir_filter_ccc.py
index 357e3d7..366c0e0 100755
--- a/gr-filter/examples/fir_filter_ccc.py
+++ b/gr-filter/examples/fir_filter_ccc.py
@@ -20,6 +20,7 @@
 # Boston, MA 02110-1301, USA.
 #
 
+from __future__ import print_function
 from gnuradio import gr, filter
 from gnuradio import analog
 from gnuradio import blocks
@@ -31,13 +32,13 @@ import sys
 try:
     import scipy
 except ImportError:
-    print "Error: could not import scipy (http://www.scipy.org/)"
+    print("Error: could not import scipy (http://www.scipy.org/)")
     sys.exit(1)
 
 try:
     import pylab
 except ImportError:
-    print "Error: could not import pylab (http://matplotlib.sourceforge.net/)"
+    print("Error: could not import pylab (http://matplotlib.sourceforge.net/)")
     sys.exit(1)
 
 class example_fir_filter_ccc(gr.top_block):
@@ -51,7 +52,7 @@ class example_fir_filter_ccc(gr.top_block):
         self._at = atten
         self._decim = D
         taps = filter.firdes.low_pass_2(1, self._fs, self._bw, self._tw, 
self._at)
-        print "Num. Taps: ", len(taps)
+        print("Num. Taps: ", len(taps))
 
         self.src  = analog.noise_source_c(analog.GR_GAUSSIAN, 1)
         self.head = blocks.head(gr.sizeof_gr_complex, self._nsamps)
diff --git a/gr-filter/examples/fir_filter_fff.py 
b/gr-filter/examples/fir_filter_fff.py
index 2019215..a774603 100755
--- a/gr-filter/examples/fir_filter_fff.py
+++ b/gr-filter/examples/fir_filter_fff.py
@@ -20,6 +20,7 @@
 # Boston, MA 02110-1301, USA.
 #
 
+from __future__ import print_function
 from gnuradio import gr, filter
 from gnuradio import analog
 from gnuradio import blocks
@@ -31,13 +32,13 @@ import sys
 try:
     import scipy
 except ImportError:
-    print "Error: could not import scipy (http://www.scipy.org/)"
+    print("Error: could not import scipy (http://www.scipy.org/)")
     sys.exit(1)
 
 try:
     import pylab
 except ImportError:
-    print "Error: could not import pylab (http://matplotlib.sourceforge.net/)"
+    print("Error: could not import pylab (http://matplotlib.sourceforge.net/)")
     sys.exit(1)
 
 class example_fir_filter_fff(gr.top_block):
@@ -51,7 +52,7 @@ class example_fir_filter_fff(gr.top_block):
         self._at = atten
         self._decim = D
         taps = filter.firdes.low_pass_2(1, self._fs, self._bw, self._tw, 
self._at)
-        print "Num. Taps: ", len(taps)
+        print("Num. Taps: ", len(taps))
 
         self.src  = analog.noise_source_f(analog.GR_GAUSSIAN, 1)
         self.head = blocks.head(gr.sizeof_float, self._nsamps)
diff --git a/gr-filter/examples/gr_filtdes_api.py 
b/gr-filter/examples/gr_filtdes_api.py
index 6d7716c..4c59c99 100755
--- a/gr-filter/examples/gr_filtdes_api.py
+++ b/gr-filter/examples/gr_filtdes_api.py
@@ -20,6 +20,7 @@
 # Boston, MA 02110-1301, USA.
 #
 
+from __future__ import print_function
 from gnuradio.filter import filter_design
 import sys
 
@@ -31,7 +32,7 @@ returns b,a for IIR filter design
 filtobj = filter_design.launch(sys.argv)
 
 # Displaying all filter paramters
-print "Filter Count:", filtobj.get_filtercount()
-print "Filter type:", filtobj.get_restype()
-print "Filter params", filtobj.get_params()
-print "Filter Coefficients", filtobj.get_taps()
+print("Filter Count:", filtobj.get_filtercount())
+print("Filter type:", filtobj.get_restype())
+print("Filter params", filtobj.get_params())
+print("Filter Coefficients", filtobj.get_taps())
diff --git a/gr-filter/examples/gr_filtdes_callback.py 
b/gr-filter/examples/gr_filtdes_callback.py
index 9496253..0aaae59 100755
--- a/gr-filter/examples/gr_filtdes_callback.py
+++ b/gr-filter/examples/gr_filtdes_callback.py
@@ -20,13 +20,14 @@
 # Boston, MA 02110-1301, USA.
 #
 
+from __future__ import print_function
 from gnuradio.filter import filter_design
 import sys
 try:
     from PyQt4 import Qt, QtCore, QtGui
 except ImportError:
-    print "Please install PyQt4 to run this script 
(http://www.riverbankcomputing.co.uk/software/pyqt/download)"
-    raise SystemExit, 1
+    print("Please install PyQt4 to run this script 
(http://www.riverbankcomputing.co.uk/software/pyqt/download)")
+    raise SystemExit(1)
 
 '''
 Callback example
@@ -36,10 +37,10 @@ launch function returns gr_filter_design mainwindow
 object when callback is not None
 '''
 def print_params(filtobj):
-    print "Filter Count:", filtobj.get_filtercount()
-    print "Filter type:", filtobj.get_restype()
-    print "Filter params", filtobj.get_params()
-    print "Filter Coefficients", filtobj.get_taps()
+    print("Filter Count:", filtobj.get_filtercount())
+    print("Filter type:", filtobj.get_restype())
+    print("Filter params", filtobj.get_params())
+    print("Filter Coefficients", filtobj.get_taps())
 
 app = Qt.QApplication(sys.argv)
 #launch function returns gr_filter_design mainwindow object
diff --git a/gr-filter/examples/gr_filtdes_live_upd.py 
b/gr-filter/examples/gr_filtdes_live_upd.py
index 9f974dd..b31a0f9 100755
--- a/gr-filter/examples/gr_filtdes_live_upd.py
+++ b/gr-filter/examples/gr_filtdes_live_upd.py
@@ -20,6 +20,7 @@
 # Boston, MA 02110-1301, USA.
 #
 
+from __future__ import print_function
 from gnuradio.filter import filter_design
 from gnuradio import gr, filter
 from gnuradio import blocks
@@ -89,8 +90,8 @@ class my_top_block(gr.top_block):
         pyWin.show()
 
     def update_filter(self, filtobj):
-        print "Filter type:", filtobj.get_restype()
-        print "Filter params", filtobj.get_params()
+        print("Filter type:", filtobj.get_restype())
+        print("Filter params", filtobj.get_params())
         self.filt.set_taps(filtobj.get_taps())
 
 if __name__ == "__main__":
diff --git a/gr-filter/examples/gr_filtdes_restrict.py 
b/gr-filter/examples/gr_filtdes_restrict.py
index 1613cc6..266d71b 100755
--- a/gr-filter/examples/gr_filtdes_restrict.py
+++ b/gr-filter/examples/gr_filtdes_restrict.py
@@ -20,13 +20,14 @@
 # Boston, MA 02110-1301, USA.
 #
 
+from __future__ import print_function
 from gnuradio.filter import filter_design
 import sys
 try:
     from PyQt4 import Qt, QtCore, QtGui
 except ImportError:
-    print "Please install PyQt4 to run this script 
(http://www.riverbankcomputing.co.uk/software/pyqt/download)"
-    raise SystemExit, 1
+    print("Please install PyQt4 to run this script 
(http://www.riverbankcomputing.co.uk/software/pyqt/download)")
+    raise SystemExit(1)
 
 
 '''
@@ -35,10 +36,10 @@ Function called when "design" button is pressed
 or pole-zero plot is changed
 '''
 def print_params(filtobj):
-    print "Filter Count:", filtobj.get_filtercount()
-    print "Filter type:", filtobj.get_restype()
-    print "Filter params", filtobj.get_params()
-    print "Filter Coefficients", filtobj.get_taps()
+    print("Filter Count:", filtobj.get_filtercount())
+    print("Filter type:", filtobj.get_restype())
+    print("Filter params", filtobj.get_params())
+    print("Filter Coefficients", filtobj.get_taps())
 
 app = Qt.QApplication(sys.argv)
 main_win = filter_design.launch(sys.argv, callback = print_params, restype = 
"iir")
diff --git a/gr-filter/examples/interpolate.py 
b/gr-filter/examples/interpolate.py
index 40bab7b..0e29f87 100755
--- a/gr-filter/examples/interpolate.py
+++ b/gr-filter/examples/interpolate.py
@@ -20,6 +20,7 @@
 # Boston, MA 02110-1301, USA.
 #
 
+from __future__ import print_function
 from gnuradio import gr
 from gnuradio import blocks
 from gnuradio import filter
@@ -80,9 +81,9 @@ class pfb_top_block(gr.top_block):
 
         # Calculate the number of taps per channel for our own information
         tpc = scipy.ceil(float(len(self._taps)) /  float(self._interp))
-        print "Number of taps:     ", len(self._taps)
-        print "Number of filters:  ", self._interp
-        print "Taps per channel:   ", tpc
+        print("Number of taps:     ", len(self._taps))
+        print("Number of filters:  ", self._interp)
+        print("Taps per channel:   ", tpc)
 
         # Create a couple of signals at different frequencies
         self.signal1 = analog.sig_source_c(self._fs, analog.GR_SIN_WAVE, 
freq1, 0.5)
@@ -121,7 +122,7 @@ def main():
     tstart = time.time()
     tb.run()
     tend = time.time()
-    print "Run time: %f" % (tend - tstart)
+    print("Run time: %f" % (tend - tstart))
 
 
     if 1:
diff --git a/gr-filter/examples/reconstruction.py 
b/gr-filter/examples/reconstruction.py
index 0a83b5a..27d2403 100755
--- a/gr-filter/examples/reconstruction.py
+++ b/gr-filter/examples/reconstruction.py
@@ -20,6 +20,7 @@
 # Boston, MA 02110-1301, USA.
 #
 
+from __future__ import print_function
 from gnuradio import gr, digital
 from gnuradio import filter
 from gnuradio import blocks
@@ -28,20 +29,20 @@ import sys
 try:
     from gnuradio import channels
 except ImportError:
-    print "Error: Program requires gr-channels."
+    print("Error: Program requires gr-channels.")
     sys.exit(1)
 
 try:
     import scipy
     from scipy import fftpack
 except ImportError:
-    print "Error: Program requires scipy (see: www.scipy.org)."
+    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)."
+    print("Error: Program requires matplotlib (see: 
matplotlib.sourceforge.net).")
     sys.exit(1)
 
 fftlen = 8192
@@ -62,7 +63,7 @@ def main():
     proto_taps = filter.firdes.low_pass_2(1, nchans*fs,
                                           bw, tb, 80,
                                           filter.firdes.WIN_BLACKMAN_hARRIS)
-    print "Filter length: ", len(proto_taps)
+    print("Filter length: ", len(proto_taps))
 
 
     # Create a modulated signal
diff --git a/gr-filter/examples/resampler.py b/gr-filter/examples/resampler.py
index e329f06..9e169fb 100755
--- a/gr-filter/examples/resampler.py
+++ b/gr-filter/examples/resampler.py
@@ -20,6 +20,7 @@
 # Boston, MA 02110-1301, USA.
 #
 
+from __future__ import print_function
 from gnuradio import gr
 from gnuradio import filter
 from gnuradio import blocks
@@ -48,7 +49,7 @@ class mytb(gr.top_block):
         gr.top_block.__init__(self)
 
         rerate = float(fs_out) / float(fs_in)
-        print "Resampling from %f to %f by %f " %(fs_in, fs_out, rerate)
+        print("Resampling from %f to %f by %f " %(fs_in, fs_out, rerate))
 
         # Creating our own taps
         taps = filter.firdes.low_pass_2(32, 32, 0.25, 0.1, 80)
diff --git a/gr-filter/examples/synth_filter.py 
b/gr-filter/examples/synth_filter.py
index 5382127..db8ab6c 100755
--- a/gr-filter/examples/synth_filter.py
+++ b/gr-filter/examples/synth_filter.py
@@ -20,6 +20,7 @@
 # Boston, MA 02110-1301, USA.
 #
 
+from __future__ import print_function
 from gnuradio import gr
 from gnuradio import filter
 from gnuradio import blocks
@@ -57,8 +58,8 @@ def main():
 
     taps = filter.firdes.low_pass_2(len(freqs), fs,
                                     fs/float(nchans)/2, 100, 100)
-    print "Num. Taps = %d (taps per filter = %d)" % (len(taps),
-                                                     len(taps)/nchans)
+    print("Num. Taps = %d (taps per filter = %d)" % (len(taps),
+                                                     len(taps)/nchans))
     filtbank = filter.pfb_synthesizer_ccf(nchans, taps)
 
     head = blocks.head(gr.sizeof_gr_complex, N)
diff --git a/gr-filter/examples/synth_to_chan.py 
b/gr-filter/examples/synth_to_chan.py
index 88fb080..c6672be 100755
--- a/gr-filter/examples/synth_to_chan.py
+++ b/gr-filter/examples/synth_to_chan.py
@@ -20,6 +20,7 @@
 # Boston, MA 02110-1301, USA.
 #
 
+from __future__ import print_function
 from gnuradio import gr
 from gnuradio import blocks
 from gnuradio import filter
@@ -59,11 +60,11 @@ def main():
         fmtx.append(fm)
 
     syntaps = filter.firdes.low_pass_2(len(freqs), fs, fs/float(nchans)/2, 
100, 100)
-    print "Synthesis Num. Taps = %d (taps per filter = %d)" % (len(syntaps),
-                                                               
len(syntaps)/nchans)
+    print("Synthesis Num. Taps = %d (taps per filter = %d)" % (len(syntaps),
+                                                               
len(syntaps)/nchans))
     chtaps = filter.firdes.low_pass_2(len(freqs), fs, fs/float(nchans)/2, 100, 
100)
-    print "Channelizer Num. Taps = %d (taps per filter = %d)" % (len(chtaps),
-                                                                 
len(chtaps)/nchans)
+    print("Channelizer Num. Taps = %d (taps per filter = %d)" % (len(chtaps),
+                                                                 
len(chtaps)/nchans))
     filtbank = filter.pfb_synthesizer_ccf(nchans, syntaps)
     channelizer = filter.pfb.channelizer_ccf(nchans, chtaps)
 
diff --git a/gr-filter/python/filter/__init__.py 
b/gr-filter/python/filter/__init__.py
index cbbc80f..ab8908d 100644
--- a/gr-filter/python/filter/__init__.py
+++ b/gr-filter/python/filter/__init__.py
@@ -22,6 +22,7 @@
 '''
 Filter blocks and related functions.
 '''
+from __future__ import absolute_import
 import os
 
 try:
@@ -30,11 +31,11 @@ except ImportError:
     dirname, filename = os.path.split(os.path.abspath(__file__))
     __path__.append(os.path.join(dirname, "..", "..", "swig"))
     from filter_swig import *
-from filterbank import *
-from freq_xlating_fft_filter import *
-from rational_resampler import *
-import pfb
-import optfir
+from .filterbank import *
+from .freq_xlating_fft_filter import *
+from .rational_resampler import *
+from . import pfb
+from . import optfir
 
 # Pull this into the filter module
 from gnuradio.fft import window
diff --git a/gr-filter/python/filter/qa_fft_filter.py 
b/gr-filter/python/filter/qa_fft_filter.py
index 172b945..b2d5857 100755
--- a/gr-filter/python/filter/qa_fft_filter.py
+++ b/gr-filter/python/filter/qa_fft_filter.py
@@ -411,10 +411,10 @@ class test_fft_filter(gr_unittest.TestCase):
             except:
                 expected = open('expected', 'w')
                 for x in expected_result:
-                    expected.write(`x` + '\n')
+                    expected.write(repr(x) + '\n')
                 actual = open('actual', 'w')
                 for x in result_data:
-                    actual.write(`x` + '\n')
+                    actual.write(repr(x) + '\n')
                 raise
 
     def xtest_fff_005(self):
diff --git a/gr-filter/python/filter/qa_pm_remez.py 
b/gr-filter/python/filter/qa_pm_remez.py
index af85f9e..288f1fd 100755
--- a/gr-filter/python/filter/qa_pm_remez.py
+++ b/gr-filter/python/filter/qa_pm_remez.py
@@ -55,10 +55,10 @@ def remezord (fcuts, mags, devs, fsamp = 2):
     nbands = nm
 
     if nm != nd:
-        raise ValueError, "Length of mags and devs must be equal"
+        raise ValueError("Length of mags and devs must be equal")
 
     if nf != 2 * (nbands - 1):
-        raise ValueError, "Length of f must be 2 * len (mags) - 2"
+        raise ValueError("Length of f must be 2 * len (mags) - 2")
 
     for i in range (len (mags)):
         if mags[i] != 0:                        # if not stopband, get 
relative deviation
diff --git a/gr-filter/python/filter/qa_rational_resampler.py 
b/gr-filter/python/filter/qa_rational_resampler.py
index a03673d..df0c2f4 100755
--- a/gr-filter/python/filter/qa_rational_resampler.py
+++ b/gr-filter/python/filter/qa_rational_resampler.py
@@ -20,6 +20,7 @@
 # Boston, MA 02110-1301, USA.
 #
 
+from __future__ import print_function
 from gnuradio import gr, gr_unittest, filter, blocks
 import math
 import random
@@ -155,8 +156,8 @@ class test_rational_resampler (gr_unittest.TestCase):
 
         N = 10
         offset = 10#len(taps)-1
-        print expected_result[100+offset:100+offset+N]
-        print result_data[100:100+N]
+        print(expected_result[100+offset:100+offset+N])
+        print(result_data[100:100+N])
         #self.assertEqual(expected_result[offset:offset+N], result_data[0:N])
 
     # FIXME disabled.  Triggers hang on SuSE 10.0
diff --git a/gr-qtgui/apps/plot_psd_base.py b/gr-qtgui/apps/plot_psd_base.py
index bfe5383..d28fecd 100644
--- a/gr-qtgui/apps/plot_psd_base.py
+++ b/gr-qtgui/apps/plot_psd_base.py
@@ -78,8 +78,8 @@ class plot_base(gr.top_block):
 
         n = 0
         self.srcs = list()
-        self._data_min = sys.maxint
-        self._data_max = -sys.maxint - 1
+        self._data_min = sys.maxsize
+        self._data_max = -sys.maxsize - 1
         for f in self._filelist:
             data,_min,_max = self.read_samples(f, self._start,
                                                self._nsamps, self._psd_size)
@@ -129,8 +129,8 @@ class plot_base(gr.top_block):
 
         self._start = newstart
 
-        self._data_min = sys.maxint
-        self._data_max = -sys.maxint - 1
+        self._data_min = sys.maxsize
+        self._data_max = -sys.maxsize - 1
         for s,f in zip(self.srcs, self._filelist):
             data,_min,_max = self.read_samples(f, self._start, newnsamps, 
self._psd_size)
             if(_min < self._data_min):
diff --git a/gr-qtgui/apps/plot_spectrogram_base.py 
b/gr-qtgui/apps/plot_spectrogram_base.py
index dfc7763..3742857 100644
--- a/gr-qtgui/apps/plot_spectrogram_base.py
+++ b/gr-qtgui/apps/plot_spectrogram_base.py
@@ -78,8 +78,8 @@ class plot_base(gr.top_block):
 
         n = 0
         self.srcs = list()
-        self._data_min = sys.maxint
-        self._data_max = -sys.maxint - 1
+        self._data_min = sys.maxsize
+        self._data_max = -sys.maxsize - 1
         for f in self._filelist:
             data,_min,_max = self.read_samples(f, self._start,
                                                self._nsamps, self._psd_size)
@@ -134,8 +134,8 @@ class plot_base(gr.top_block):
         self._start = newstart
         self._nsamps = newnsamps
 
-        self._data_min = sys.maxint
-        self._data_max = -sys.maxint - 1
+        self._data_min = sys.maxsize
+        self._data_max = -sys.maxsize - 1
         for s,f in zip(self.srcs, self._filelist):
             data,_min,_max = self.read_samples(f, self._start, newnsamps, 
self._psd_size)
             if(_min < self._data_min):
diff --git a/gr-qtgui/apps/plot_time_base.py b/gr-qtgui/apps/plot_time_base.py
index 3799d41..015dc27 100644
--- a/gr-qtgui/apps/plot_time_base.py
+++ b/gr-qtgui/apps/plot_time_base.py
@@ -77,8 +77,8 @@ class plot_base(gr.top_block):
 
         n = 0
         self.srcs = list()
-        self._data_min = sys.maxint
-        self._data_max = -sys.maxint - 1
+        self._data_min = sys.maxsize
+        self._data_max = -sys.maxsize - 1
         for f in self._filelist:
             data,_min,_max = self.read_samples(f, self._start, self._nsamps)
             if(_min < self._data_min):
@@ -133,8 +133,8 @@ class plot_base(gr.top_block):
 
         self._start = newstart
 
-        self._data_min = sys.maxint
-        self._data_max = -sys.maxint - 1
+        self._data_min = sys.maxsize
+        self._data_max = -sys.maxsize - 1
         for s,f in zip(self.srcs, self._filelist):
             data,_min,_max = self.read_samples(f, self._start, newnsamps)
             if(_min < self._data_min):
diff --git a/gr-qtgui/apps/plot_time_raster_base.py 
b/gr-qtgui/apps/plot_time_raster_base.py
index 17cecc3..f149b83 100644
--- a/gr-qtgui/apps/plot_time_raster_base.py
+++ b/gr-qtgui/apps/plot_time_raster_base.py
@@ -77,8 +77,8 @@ class plot_base(gr.top_block):
 
         n = 0
         self.srcs = list()
-        self._data_min = sys.maxint
-        self._data_max = -sys.maxint - 1
+        self._data_min = sys.maxsize
+        self._data_max = -sys.maxsize - 1
         for f in self._filelist:
             data,_min,_max = self.read_samples(f, self._start, self._nsamps)
             if(_min < self._data_min):
@@ -131,8 +131,8 @@ class plot_base(gr.top_block):
 
         self._start = newstart
 
-        self._data_min = sys.maxint
-        self._data_max = -sys.maxint - 1
+        self._data_min = sys.maxsize
+        self._data_max = -sys.maxsize - 1
         for s,f in zip(self.srcs, self._filelist):
             data,_min,_max = self.read_samples(f, self._start, newnsamps)
             if(_min < self._data_min):
diff --git a/gr-qtgui/apps/uhd_display.py b/gr-qtgui/apps/uhd_display.py
index 0e0c8a1..97d51fd 100755
--- a/gr-qtgui/apps/uhd_display.py
+++ b/gr-qtgui/apps/uhd_display.py
@@ -20,6 +20,7 @@
 # Boston, MA 02110-1301, USA.
 #
 
+from __future__ import print_function
 from gnuradio import gr
 from gnuradio import filter
 from gnuradio import blocks
@@ -34,14 +35,14 @@ try:
     from PyQt4 import QtGui, QtCore
     import sip
 except ImportError:
-    print "Error: Program requires PyQt4 and gr-qtgui."
+    print("Error: Program requires PyQt4 and gr-qtgui.")
     sys.exit(1)
 
 try:
     from usrp_display_qtgui import Ui_MainWindow
 except ImportError:
-    print "Error: could not find usrp_display_qtgui.py:"
-    print "\t\"pyuic4 usrp_display_qtgui.ui -o usrp_display_qtgui.py\""
+    print("Error: could not find usrp_display_qtgui.py:")
+    print("\t\"pyuic4 usrp_display_qtgui.ui -o usrp_display_qtgui.py\"")
     sys.exit(1)
 
 
@@ -212,9 +213,9 @@ class my_top_block(gr.top_block):
         self.connect(self.u, self.amp, self.snk)
 
         if self.show_debug_info:
-            print "Bandwidth: ", self.u.get_samp_rate()
-            print "Center Freq: ", self.u.get_center_freq()
-            print "Freq Range: ", self.u.get_freq_range()
+            print("Bandwidth: ", self.u.get_samp_rate())
+            print("Center Freq: ", self.u.get_center_freq())
+            print("Freq Range: ", self.u.get_freq_range())
 
         # Get the reference pointer to the SpectrumDisplayForm QWidget
         # Wrap the pointer as a PyQt SIP object
diff --git a/gr-qtgui/examples/pyqt_const_c.py 
b/gr-qtgui/examples/pyqt_const_c.py
index 0bb6c20..7ef8c58 100755
--- a/gr-qtgui/examples/pyqt_const_c.py
+++ b/gr-qtgui/examples/pyqt_const_c.py
@@ -20,6 +20,7 @@
 # Boston, MA 02110-1301, USA.
 #
 
+from __future__ import print_function
 from gnuradio import gr, filter
 from gnuradio import blocks
 import sys
@@ -109,14 +110,14 @@ class control_box(QtWidgets.QWidget):
             newfreq = float(self.freq1Edit.text())
             self.signal1.set_frequency(newfreq)
         except ValueError:
-            print "Bad frequency value entered"
+            print("Bad frequency value entered")
 
     def amp1EditText(self):
         try:
             newamp = float(self.amp1Edit.text())
             self.signal1.set_amplitude(newamp)
         except ValueError:
-            print "Bad amplitude value entered"
+            print("Bad amplitude value entered")
 
 
     def freq2EditText(self):
@@ -124,14 +125,14 @@ class control_box(QtWidgets.QWidget):
             newfreq = float(self.freq2Edit.text())
             self.signal2.set_frequency(newfreq)
         except ValueError:
-            print "Bad frequency value entered"
+            print("Bad frequency value entered")
 
     def amp2EditText(self):
         try:
             newamp = float(self.amp2Edit.text())
             self.signal2.set_amplitude(newamp)
         except ValueError:
-            print "Bad amplitude value entered"
+            print("Bad amplitude value entered")
 
 
 class my_top_block(gr.top_block):
diff --git a/gr-qtgui/examples/pyqt_example_c.py 
b/gr-qtgui/examples/pyqt_example_c.py
index 89ca7b2..81a67c6 100755
--- a/gr-qtgui/examples/pyqt_example_c.py
+++ b/gr-qtgui/examples/pyqt_example_c.py
@@ -20,6 +20,7 @@
 # Boston, MA 02110-1301, USA.
 #
 
+from __future__ import print_function
 from gnuradio import gr, filter
 from gnuradio import blocks
 import sys
@@ -110,14 +111,14 @@ class control_box(QtWidgets.QWidget):
             newfreq = float(self.freq1Edit.text())
             self.signal1.set_frequency(newfreq)
         except ValueError:
-            print "Bad frequency value entered"
+            print("Bad frequency value entered")
 
     def amp1EditText(self):
         try:
             newamp = float(self.amp1Edit.text())
             self.signal1.set_amplitude(newamp)
         except ValueError:
-            print "Bad amplitude value entered"
+            print("Bad amplitude value entered")
 
 
     def freq2EditText(self):
@@ -125,14 +126,14 @@ class control_box(QtWidgets.QWidget):
             newfreq = float(self.freq2Edit.text())
             self.signal2.set_frequency(newfreq)
         except ValueError:
-            print "Bad frequency value entered"
+            print("Bad frequency value entered")
 
     def amp2EditText(self):
         try:
             newamp = float(self.amp2Edit.text())
             self.signal2.set_amplitude(newamp)
         except ValueError:
-            print "Bad amplitude value entered"
+            print("Bad amplitude value entered")
 
 
 class my_top_block(gr.top_block):
diff --git a/gr-qtgui/examples/pyqt_example_f.py 
b/gr-qtgui/examples/pyqt_example_f.py
index 77a7478..e0a8739 100755
--- a/gr-qtgui/examples/pyqt_example_f.py
+++ b/gr-qtgui/examples/pyqt_example_f.py
@@ -20,6 +20,7 @@
 # Boston, MA 02110-1301, USA.
 #
 
+from __future__ import print_function
 from gnuradio import gr, filter
 from gnuradio import blocks
 import sys
@@ -104,14 +105,14 @@ class control_box(QtWidgets.QWidget):
             newfreq = float(self.freq1Edit.text())
             self.signal1.set_frequency(newfreq)
         except ValueError:
-            print "Bad frequency value entered"
+            print("Bad frequency value entered")
 
     def amp1EditText(self):
         try:
             newamp = float(self.amp1Edit.text())
             self.signal1.set_amplitude(newamp)
         except ValueError:
-            print "Bad amplitude value entered"
+            print("Bad amplitude value entered")
 
 
     def freq2EditText(self):
@@ -119,14 +120,14 @@ class control_box(QtWidgets.QWidget):
             newfreq = float(self.freq2Edit.text())
             self.signal2.set_frequency(newfreq)
         except ValueError:
-            print "Bad frequency value entered"
+            print("Bad frequency value entered")
 
     def amp2EditText(self):
         try:
             newamp = float(self.amp2Edit.text())
             self.signal2.set_amplitude(newamp)
         except ValueError:
-            print "Bad amplitude value entered"
+            print("Bad amplitude value entered")
 
 
 class my_top_block(gr.top_block):
diff --git a/gr-qtgui/examples/pyqt_freq_c.py b/gr-qtgui/examples/pyqt_freq_c.py
index 954a078..f99f564 100755
--- a/gr-qtgui/examples/pyqt_freq_c.py
+++ b/gr-qtgui/examples/pyqt_freq_c.py
@@ -20,6 +20,7 @@
 # Boston, MA 02110-1301, USA.
 #
 
+from __future__ import print_function
 from gnuradio import gr, filter
 from gnuradio import blocks
 import sys
@@ -110,14 +111,14 @@ class control_box(QtWidgets.QWidget):
             newfreq = float(self.freq1Edit.text())
             self.signal1.set_frequency(newfreq)
         except ValueError:
-            print "Bad frequency value entered"
+            print("Bad frequency value entered")
 
     def amp1EditText(self):
         try:
             newamp = float(self.amp1Edit.text())
             self.signal1.set_amplitude(newamp)
         except ValueError:
-            print "Bad amplitude value entered"
+            print("Bad amplitude value entered")
 
 
     def freq2EditText(self):
@@ -125,14 +126,14 @@ class control_box(QtWidgets.QWidget):
             newfreq = float(self.freq2Edit.text())
             self.signal2.set_frequency(newfreq)
         except ValueError:
-            print "Bad frequency value entered"
+            print("Bad frequency value entered")
 
     def amp2EditText(self):
         try:
             newamp = float(self.amp2Edit.text())
             self.signal2.set_amplitude(newamp)
         except ValueError:
-            print "Bad amplitude value entered"
+            print("Bad amplitude value entered")
 
 
 class my_top_block(gr.top_block):
diff --git a/gr-qtgui/examples/pyqt_freq_f.py b/gr-qtgui/examples/pyqt_freq_f.py
index d7d389b..a846524 100755
--- a/gr-qtgui/examples/pyqt_freq_f.py
+++ b/gr-qtgui/examples/pyqt_freq_f.py
@@ -20,6 +20,7 @@
 # Boston, MA 02110-1301, USA.
 #
 
+from __future__ import print_function
 from gnuradio import gr, filter
 from gnuradio import blocks
 import sys
@@ -105,14 +106,14 @@ class control_box(QtWidgets.QWidget):
             newfreq = float(self.freq1Edit.text())
             self.signal1.set_frequency(newfreq)
         except ValueError:
-            print "Bad frequency value entered"
+            print("Bad frequency value entered")
 
     def amp1EditText(self):
         try:
             newamp = float(self.amp1Edit.text())
             self.signal1.set_amplitude(newamp)
         except ValueError:
-            print "Bad amplitude value entered"
+            print("Bad amplitude value entered")
 
 
     def freq2EditText(self):
@@ -120,14 +121,14 @@ class control_box(QtWidgets.QWidget):
             newfreq = float(self.freq2Edit.text())
             self.signal2.set_frequency(newfreq)
         except ValueError:
-            print "Bad frequency value entered"
+            print("Bad frequency value entered")
 
     def amp2EditText(self):
         try:
             newamp = float(self.amp2Edit.text())
             self.signal2.set_amplitude(newamp)
         except ValueError:
-            print "Bad amplitude value entered"
+            print("Bad amplitude value entered")
 
 
 class my_top_block(gr.top_block):
diff --git a/gr-qtgui/examples/pyqt_histogram_f.py 
b/gr-qtgui/examples/pyqt_histogram_f.py
index 81f7b9d..1972f47 100755
--- a/gr-qtgui/examples/pyqt_histogram_f.py
+++ b/gr-qtgui/examples/pyqt_histogram_f.py
@@ -20,6 +20,7 @@
 # Boston, MA 02110-1301, USA.
 #
 
+from __future__ import print_function
 from gnuradio import gr
 from gnuradio import blocks
 import sys
@@ -118,21 +119,21 @@ class control_box(QtWidgets.QWidget):
             newfreq = float(self.freq1Edit.text())
             self.signal1.set_frequency(newfreq)
         except ValueError:
-            print "Bad frequency value entered"
+            print("Bad frequency value entered")
 
     def amp1EditText(self):
         try:
             newamp = float(self.amp1Edit.text())
             self.signal1.set_amplitude(newamp)
         except ValueError:
-            print "Bad amplitude value entered"
+            print("Bad amplitude value entered")
 
     def amp2EditText(self):
         try:
             newamp = float(self.amp2Edit.text())
             self.signal2.set_amplitude(newamp)
         except ValueError:
-            print "Bad amplitude value entered"
+            print("Bad amplitude value entered")
 
     def set_nsamps(self):
         res = self.hist_npts.text().toInt()
diff --git a/gr-qtgui/examples/pyqt_time_c.py b/gr-qtgui/examples/pyqt_time_c.py
index b595c8f..705818c 100755
--- a/gr-qtgui/examples/pyqt_time_c.py
+++ b/gr-qtgui/examples/pyqt_time_c.py
@@ -20,6 +20,7 @@
 # Boston, MA 02110-1301, USA.
 #
 
+from __future__ import print_function
 from gnuradio import gr
 from gnuradio import blocks
 import sys
@@ -110,14 +111,14 @@ class control_box(QtWidgets.QWidget):
             newfreq = float(self.freq1Edit.text())
             self.signal1.set_frequency(newfreq)
         except ValueError:
-            print "Bad frequency value entered"
+            print("Bad frequency value entered")
 
     def amp1EditText(self):
         try:
             newamp = float(self.amp1Edit.text())
             self.signal1.set_amplitude(newamp)
         except ValueError:
-            print "Bad amplitude value entered"
+            print("Bad amplitude value entered")
 
 
     def freq2EditText(self):
@@ -125,14 +126,14 @@ class control_box(QtWidgets.QWidget):
             newfreq = float(self.freq2Edit.text())
             self.signal2.set_frequency(newfreq)
         except ValueError:
-            print "Bad frequency value entered"
+            print("Bad frequency value entered")
 
     def amp2EditText(self):
         try:
             newamp = float(self.amp2Edit.text())
             self.signal2.set_amplitude(newamp)
         except ValueError:
-            print "Bad amplitude value entered"
+            print("Bad amplitude value entered")
 
 
 class my_top_block(gr.top_block):
diff --git a/gr-qtgui/examples/pyqt_time_f.py b/gr-qtgui/examples/pyqt_time_f.py
index 3689ebf..205a5d7 100755
--- a/gr-qtgui/examples/pyqt_time_f.py
+++ b/gr-qtgui/examples/pyqt_time_f.py
@@ -20,6 +20,7 @@
 # Boston, MA 02110-1301, USA.
 #
 
+from __future__ import print_function
 from gnuradio import gr
 from gnuradio import blocks
 import sys
@@ -104,14 +105,14 @@ class control_box(QtWidgets.QWidget):
             newfreq = float(self.freq1Edit.text())
             self.signal1.set_frequency(newfreq)
         except ValueError:
-            print "Bad frequency value entered"
+            print("Bad frequency value entered")
 
     def amp1EditText(self):
         try:
             newamp = float(self.amp1Edit.text())
             self.signal1.set_amplitude(newamp)
         except ValueError:
-            print "Bad amplitude value entered"
+            print("Bad amplitude value entered")
 
 
     def freq2EditText(self):
@@ -119,14 +120,14 @@ class control_box(QtWidgets.QWidget):
             newfreq = float(self.freq2Edit.text())
             self.signal2.set_frequency(newfreq)
         except ValueError:
-            print "Bad frequency value entered"
+            print("Bad frequency value entered")
 
     def amp2EditText(self):
         try:
             newamp = float(self.amp2Edit.text())
             self.signal2.set_amplitude(newamp)
         except ValueError:
-            print "Bad amplitude value entered"
+            print("Bad amplitude value entered")
 
 
 class my_top_block(gr.top_block):
diff --git a/gr-qtgui/examples/pyqt_time_raster_b.py 
b/gr-qtgui/examples/pyqt_time_raster_b.py
index 7a94400..9dfac34 100755
--- a/gr-qtgui/examples/pyqt_time_raster_b.py
+++ b/gr-qtgui/examples/pyqt_time_raster_b.py
@@ -20,6 +20,7 @@
 # Boston, MA 02110-1301, USA.
 #
 
+from __future__ import print_function
 from gnuradio import gr
 from gnuradio import blocks
 from gnuradio import blocks
@@ -30,7 +31,7 @@ try:
     from PyQt5 import QtWidgets, Qt
     import sip
 except ImportError:
-    print "Error: Program requires PyQt5 and gr-qtgui."
+    print("Error: Program requires PyQt5 and gr-qtgui.")
     sys.exit(1)
 
 class dialog_box(QtWidgets.QWidget):
diff --git a/gr-qtgui/examples/pyqt_time_raster_f.py 
b/gr-qtgui/examples/pyqt_time_raster_f.py
index 0f9de94..cd7a187 100755
--- a/gr-qtgui/examples/pyqt_time_raster_f.py
+++ b/gr-qtgui/examples/pyqt_time_raster_f.py
@@ -20,6 +20,7 @@
 # Boston, MA 02110-1301, USA.
 #
 
+from __future__ import print_function
 from gnuradio import gr
 from gnuradio import blocks
 import sys
@@ -29,7 +30,7 @@ try:
     from PyQt5 import QtWidgets, Qt
     import sip
 except ImportError:
-    print "Error: Program requires PyQt5 and gr-qtgui."
+    print("Error: Program requires PyQt5 and gr-qtgui.")
     sys.exit(1)
 
 class dialog_box(QtWidgets.QWidget):
diff --git a/gr-qtgui/examples/pyqt_waterfall_c.py 
b/gr-qtgui/examples/pyqt_waterfall_c.py
index 3f7119f..581a915 100755
--- a/gr-qtgui/examples/pyqt_waterfall_c.py
+++ b/gr-qtgui/examples/pyqt_waterfall_c.py
@@ -20,6 +20,7 @@
 # Boston, MA 02110-1301, USA.
 #
 
+from __future__ import print_function
 from gnuradio import gr, filter
 from gnuradio import blocks
 import sys
@@ -110,14 +111,14 @@ class control_box(QtWidgets.QWidget):
             newfreq = float(self.freq1Edit.text())
             self.signal1.set_frequency(newfreq)
         except ValueError:
-            print "Bad frequency value entered"
+            print("Bad frequency value entered")
 
     def amp1EditText(self):
         try:
             newamp = float(self.amp1Edit.text())
             self.signal1.set_amplitude(newamp)
         except ValueError:
-            print "Bad amplitude value entered"
+            print("Bad amplitude value entered")
 
 
     def freq2EditText(self):
@@ -125,14 +126,14 @@ class control_box(QtWidgets.QWidget):
             newfreq = float(self.freq2Edit.text())
             self.signal2.set_frequency(newfreq)
         except ValueError:
-            print "Bad frequency value entered"
+            print("Bad frequency value entered")
 
     def amp2EditText(self):
         try:
             newamp = float(self.amp2Edit.text())
             self.signal2.set_amplitude(newamp)
         except ValueError:
-            print "Bad amplitude value entered"
+            print("Bad amplitude value entered")
 
 
 class my_top_block(gr.top_block):
diff --git a/gr-qtgui/examples/pyqt_waterfall_f.py 
b/gr-qtgui/examples/pyqt_waterfall_f.py
index 71c72af..e9b0d5d 100755
--- a/gr-qtgui/examples/pyqt_waterfall_f.py
+++ b/gr-qtgui/examples/pyqt_waterfall_f.py
@@ -20,6 +20,7 @@
 # Boston, MA 02110-1301, USA.
 #
 
+from __future__ import print_function
 from gnuradio import gr, filter
 from gnuradio import blocks
 import sys
@@ -104,14 +105,14 @@ class control_box(QtWidgets.QWidget):
             newfreq = float(self.freq1Edit.text())
             self.signal1.set_frequency(newfreq)
         except ValueError:
-            print "Bad frequency value entered"
+            print("Bad frequency value entered")
 
     def amp1EditText(self):
         try:
             newamp = float(self.amp1Edit.text())
             self.signal1.set_amplitude(newamp)
         except ValueError:
-            print "Bad amplitude value entered"
+            print("Bad amplitude value entered")
 
 
     def freq2EditText(self):
@@ -119,14 +120,14 @@ class control_box(QtWidgets.QWidget):
             newfreq = float(self.freq2Edit.text())
             self.signal2.set_frequency(newfreq)
         except ValueError:
-            print "Bad frequency value entered"
+            print("Bad frequency value entered")
 
     def amp2EditText(self):
         try:
             newamp = float(self.amp2Edit.text())
             self.signal2.set_amplitude(newamp)
         except ValueError:
-            print "Bad amplitude value entered"
+            print("Bad amplitude value entered")
 
 
 class my_top_block(gr.top_block):
diff --git a/gr-trellis/doc/test_tcm.py b/gr-trellis/doc/test_tcm.py
index 61ab00f..ee74e5e 100644
--- a/gr-trellis/doc/test_tcm.py
+++ b/gr-trellis/doc/test_tcm.py
@@ -1,5 +1,6 @@
 #!/usr/bin/env python
 
+from __future__ import print_function
 from gnuradio import gr
 from gnuradio import audio
 from gnuradio import trellis, digital, blocks
@@ -89,9 +90,9 @@ def main(args):
         tot_s=tot_s+s
         terr_s=terr_s+e
         if (i%100==0):
-            print i,s,e,tot_s,terr_s, '%e' % ((1.0*terr_s)/tot_s)
+            print(i,s,e,tot_s,terr_s, '%e' % ((1.0*terr_s)/tot_s))
     # estimate of the (short) error rate
-    print tot_s,terr_s, '%e' % ((1.0*terr_s)/tot_s)
+    print(tot_s,terr_s, '%e' % ((1.0*terr_s)/tot_s))
 
 
 if __name__ == '__main__':
diff --git a/gr-trellis/doc/test_viterbi_equalization1.py 
b/gr-trellis/doc/test_viterbi_equalization1.py
index c1a831d..34016f3 100755
--- a/gr-trellis/doc/test_viterbi_equalization1.py
+++ b/gr-trellis/doc/test_viterbi_equalization1.py
@@ -1,5 +1,6 @@
 #!/usr/bin/env python
 
+from __future__ import print_function
 from gnuradio import gr
 from gnuradio import audio
 from gnuradio import trellis, digital, filter, blocks
@@ -99,9 +100,9 @@ def main(args):
         terr_s=terr_s+e
         terr_p=terr_p+(terr_s!=0)
         if ((i+1)%100==0) : # display progress
-            print i+1,terr_p, '%.2e' % ((1.0*terr_p)/(i+1)),tot_s,terr_s, 
'%.2e' % ((1.0*terr_s)/tot_s)
+            print(i+1,terr_p, '%.2e' % ((1.0*terr_p)/(i+1)),tot_s,terr_s, 
'%.2e' % ((1.0*terr_s)/tot_s))
     # estimate of the (short or symbol) error rate
-    print rep,terr_p, '%.2e' % ((1.0*terr_p)/(i+1)),tot_s,terr_s, '%.2e' % 
((1.0*terr_s)/tot_s)
+    print(rep,terr_p, '%.2e' % ((1.0*terr_p)/(i+1)),tot_s,terr_s, '%.2e' % 
((1.0*terr_s)/tot_s))
 
 
 if __name__ == '__main__':
diff --git a/gr-trellis/examples/python/test_tcm.py 
b/gr-trellis/examples/python/test_tcm.py
index dfc5656..9c16083 100755
--- a/gr-trellis/examples/python/test_tcm.py
+++ b/gr-trellis/examples/python/test_tcm.py
@@ -1,5 +1,6 @@
 #!/usr/bin/env python
 
+from __future__ import print_function
 from gnuradio import gr
 from gnuradio import trellis, digital, blocks
 from gnuradio import eng_notation
@@ -56,7 +57,7 @@ def run_test 
(f,Kb,bitspersymbol,K,dimensionality,constellation,N0,seed):
     #print "final state = " , enc.ST()
 
     if len(dst.data()) != len(packet):
-        print "Error: not enough data:", len(dst.data()), len(packet)
+        print("Error: not enough data:", len(dst.data()), len(packet))
     ntotal=len(packet)
     nwrong = sum(abs(packet-numpy.array(dst.data())));
     return (ntotal,nwrong,abs(packet-numpy.array(dst.data())))
@@ -73,7 +74,7 @@ def main():
     (options, args) = parser.parse_args ()
     if len(args) != 0:
         parser.print_help()
-        raise SystemExit, 1
+        raise SystemExit(1)
 
     fname=options.fsm_file
     esn0_db=float(options.esn0)
@@ -108,14 +109,14 @@ def main():
         terr_b=terr_b+e
         terr_p=terr_p+(e!=0)
         if ((i+1)%100==0) : # display progress
-            print i+1,terr_p, '%.2e' % ((1.0*terr_p)/(i+1)),tot_b,terr_b, 
'%.2e' % ((1.0*terr_b)/tot_b)
+            print(i+1,terr_p, '%.2e' % ((1.0*terr_p)/(i+1)),tot_b,terr_b, 
'%.2e' % ((1.0*terr_b)/tot_b))
        if e!=0:
-            print "rep=",i, e
+            print("rep=",i, e)
             for k in range(Kb):
                 if pattern[k]!=0:
-                    print k
+                    print(k)
     # estimate of the bit error rate
-    print rep,terr_p, '%.2e' % ((1.0*terr_p)/(i+1)),tot_b,terr_b, '%.2e' % 
((1.0*terr_b)/tot_b)
+    print(rep,terr_p, '%.2e' % ((1.0*terr_p)/(i+1)),tot_b,terr_b, '%.2e' % 
((1.0*terr_b)/tot_b))
 
 
 
diff --git a/gr-trellis/python/trellis/qa_trellis.py 
b/gr-trellis/python/trellis/qa_trellis.py
index 86c740a..54f1c31 100755
--- a/gr-trellis/python/trellis/qa_trellis.py
+++ b/gr-trellis/python/trellis/qa_trellis.py
@@ -85,7 +85,7 @@ class trellis_tb(gr.top_block):
     """
     A simple top block for use testing gr-trellis.
     """
-    def __init__(self, constellation, f, N0=0.25, seed=-666L):
+    def __init__(self, constellation, f, N0=0.25, seed=-666):
         """
         constellation - a constellation object used for modulation.
         f - a finite state machine specification used for coding.
diff --git a/gr-uhd/python/uhd/__init__.py b/gr-uhd/python/uhd/__init__.py
index 6d7f232..50eb45d 100644
--- a/gr-uhd/python/uhd/__init__.py
+++ b/gr-uhd/python/uhd/__init__.py
@@ -114,11 +114,11 @@ def _prepare_uhd_swig():
                 ):
                     try:
                         if len(args) > index: args[index] = cast(args[index])
-                        if kwargs.has_key(key): kwargs[key] = cast(kwargs[key])
+                        if key in kwargs: kwargs[key] = cast(kwargs[key])
                     except: pass
                 #dont pass kwargs, it confuses swig, map into args list:
                 for key in ('device_addr', 'stream_args', 'io_type', 
'num_channels', 'msgq'):
-                    if kwargs.has_key(key): args.append(kwargs[key])
+                    if key in kwargs: args.append(kwargs[key])
                 return old_constructor(*args)
             return constructor_interceptor
         setattr(uhd_swig, attr, constructor_factory(getattr(uhd_swig, attr)))
diff --git a/gr-uhd/python/uhd/qa_uhd.py b/gr-uhd/python/uhd/qa_uhd.py
index 4df0d42..f5f3abe 100644
--- a/gr-uhd/python/uhd/qa_uhd.py
+++ b/gr-uhd/python/uhd/qa_uhd.py
@@ -20,6 +20,7 @@
 # Boston, MA 02110-1301, USA.
 #
 
+from __future__ import print_function
 from gnuradio import gr, gr_unittest, uhd
 
 class test_uhd(gr_unittest.TestCase):
@@ -50,7 +51,7 @@ class test_uhd(gr_unittest.TestCase):
         sa = uhd.stream_args_t()
         sa.channels.append(1)
         sa.channels.append(0)
-        print sa.channels
+        print(sa.channels)
         self.assertEqual(len(sa.channels), 2)
         self.assertEqual(sa.channels[0], 1)
         self.assertEqual(sa.channels[1], 0)
diff --git a/gr-utils/python/modtool/__init__.py 
b/gr-utils/python/modtool/__init__.py
index 897ff97..5619af2 100644
--- a/gr-utils/python/modtool/__init__.py
+++ b/gr-utils/python/modtool/__init__.py
@@ -1,3 +1,4 @@
+from __future__ import absolute_import
 #
 # Copyright 2013-2014 Free Software Foundation, Inc.
 #
@@ -19,17 +20,17 @@
 # Boston, MA 02110-1301, USA.
 #
 
-from cmakefile_editor import CMakeFileEditor
-from grc_xml_generator import GRCXMLGenerator
-from modtool_base import ModTool, ModToolException, get_modtool_modules
-from modtool_add import ModToolAdd
-from modtool_disable import ModToolDisable
-from modtool_info import ModToolInfo
-from modtool_makexml import ModToolMakeXML
-from modtool_newmod import ModToolNewModule
-from modtool_rm import ModToolRemove
-from modtool_rename import ModToolRename
-from templates import Templates
+from .cmakefile_editor import CMakeFileEditor
+from .grc_xml_generator import GRCXMLGenerator
+from .modtool_base import ModTool, ModToolException, get_modtool_modules
+from .modtool_add import ModToolAdd
+from .modtool_disable import ModToolDisable
+from .modtool_info import ModToolInfo
+from .modtool_makexml import ModToolMakeXML
+from .modtool_newmod import ModToolNewModule
+from .modtool_rm import ModToolRemove
+from .modtool_rename import ModToolRename
+from .templates import Templates
 # Leave this at the end
-from parser_cc_block import ParserCCBlock
-from util_functions import *
+from .parser_cc_block import ParserCCBlock
+from .util_functions import *
diff --git a/gr-utils/python/modtool/code_generator.py 
b/gr-utils/python/modtool/code_generator.py
index 326b2d5..cad5ef8 100644
--- a/gr-utils/python/modtool/code_generator.py
+++ b/gr-utils/python/modtool/code_generator.py
@@ -19,14 +19,15 @@
 # Boston, MA 02110-1301, USA.
 #
 """ A code generator (needed by ModToolAdd) """
+from __future__ import absolute_import
 
 from mako.template import Template
-from templates import Templates
-from util_functions import str_to_fancyc_comment
-from util_functions import str_to_python_comment
-from util_functions import strip_default_values
-from util_functions import strip_arg_types
-from util_functions import strip_arg_types_grc
+from .templates import Templates
+from .util_functions import str_to_fancyc_comment
+from .util_functions import str_to_python_comment
+from .util_functions import strip_default_values
+from .util_functions import strip_arg_types
+from .util_functions import strip_arg_types_grc
 
 GRTYPELIST = {
     'sync': 'sync_block',
diff --git a/gr-utils/python/modtool/gr-newmod/docs/doxygen/doxyxml/base.py 
b/gr-utils/python/modtool/gr-newmod/docs/doxygen/doxyxml/base.py
index b18e622..f44bcec 100644
--- a/gr-utils/python/modtool/gr-newmod/docs/doxygen/doxyxml/base.py
+++ b/gr-utils/python/modtool/gr-newmod/docs/doxygen/doxyxml/base.py
@@ -24,6 +24,7 @@ A base class is created.
 Classes based upon this are used to make more user-friendly interfaces
 to the doxygen xml docs than the generated classes provide.
 """
+from __future__ import print_function
 
 import os
 import pdb
@@ -105,8 +106,8 @@ class Base(object):
                 raise Exception('No class matched this object.')
             self.add_ref(converted)
             return converted
-        except Exception, e:
-            print e
+        except Exception as e:
+            print(e)
 
     @classmethod
     def includes(cls, inst):
diff --git 
a/gr-utils/python/modtool/gr-newmod/docs/doxygen/doxyxml/doxyindex.py 
b/gr-utils/python/modtool/gr-newmod/docs/doxygen/doxyxml/doxyindex.py
index 2dc4124..c3affb2 100644
--- a/gr-utils/python/modtool/gr-newmod/docs/doxygen/doxyxml/doxyindex.py
+++ b/gr-utils/python/modtool/gr-newmod/docs/doxygen/doxyxml/doxyindex.py
@@ -22,12 +22,13 @@
 Classes providing more user-friendly interfaces to the doxygen xml
 docs than the generated classes provide.
 """
+from __future__ import absolute_import
 
 import os
 
 from .generated import index
-from base import Base
-from text import description
+from .base import Base
+from .text import description
 
 class DoxyIndex(Base):
     """
diff --git 
a/gr-utils/python/modtool/gr-newmod/docs/doxygen/doxyxml/generated/compound.py 
b/gr-utils/python/modtool/gr-newmod/docs/doxygen/doxyxml/generated/compound.py
index c8f4b72..6f611c8 100644
--- 
a/gr-utils/python/modtool/gr-newmod/docs/doxygen/doxyxml/generated/compound.py
+++ 
b/gr-utils/python/modtool/gr-newmod/docs/doxygen/doxyxml/generated/compound.py
@@ -3,6 +3,7 @@
 """
 Generated Mon Feb  9 19:08:05 2009 by generateDS.py.
 """
+from __future__ import absolute_import
 
 
 from xml.dom import minidom
@@ -11,7 +12,7 @@ from xml.dom import Node
 import sys
 
 from . import compoundsuper as supermod
-from compoundsuper import MixedContainer
+from .compoundsuper import MixedContainer
 
 
 class DoxygenTypeSub(supermod.DoxygenType):
diff --git 
a/gr-utils/python/modtool/gr-newmod/docs/doxygen/doxyxml/generated/compoundsuper.py
 
b/gr-utils/python/modtool/gr-newmod/docs/doxygen/doxyxml/generated/compoundsuper.py
index f1996f9..7ab14a1 100644
--- 
a/gr-utils/python/modtool/gr-newmod/docs/doxygen/doxyxml/generated/compoundsuper.py
+++ 
b/gr-utils/python/modtool/gr-newmod/docs/doxygen/doxyxml/generated/compoundsuper.py
@@ -4,6 +4,7 @@
 # Generated Thu Jun 11 18:44:25 2009 by generateDS.py.
 #
 
+from __future__ import print_function
 import sys
 import getopt
 
@@ -19,7 +20,7 @@ from xml.dom import Node
 
 try:
     from generatedssuper import GeneratedsSuper
-except ImportError, exp:
+except ImportError as exp:
 
     class GeneratedsSuper:
         def format_string(self, input_data, input_name=''):
@@ -4221,7 +4222,7 @@ class codelineType(GeneratedsSuper):
         if attrs.get('lineno'):
             try:
                 self.lineno = int(attrs.get('lineno').value)
-            except ValueError, exp:
+            except ValueError as exp:
                 raise ValueError('Bad integer attribute (lineno): %s' % exp)
         if attrs.get('refkind'):
             self.refkind = attrs.get('refkind').value
@@ -4504,12 +4505,12 @@ class referenceType(GeneratedsSuper):
         if attrs.get('endline'):
             try:
                 self.endline = int(attrs.get('endline').value)
-            except ValueError, exp:
+            except ValueError as exp:
                 raise ValueError('Bad integer attribute (endline): %s' % exp)
         if attrs.get('startline'):
             try:
                 self.startline = int(attrs.get('startline').value)
-            except ValueError, exp:
+            except ValueError as exp:
                 raise ValueError('Bad integer attribute (startline): %s' % exp)
         if attrs.get('refid'):
             self.refid = attrs.get('refid').value
@@ -4627,17 +4628,17 @@ class locationType(GeneratedsSuper):
         if attrs.get('bodystart'):
             try:
                 self.bodystart = int(attrs.get('bodystart').value)
-            except ValueError, exp:
+            except ValueError as exp:
                 raise ValueError('Bad integer attribute (bodystart): %s' % exp)
         if attrs.get('line'):
             try:
                 self.line = int(attrs.get('line').value)
-            except ValueError, exp:
+            except ValueError as exp:
                 raise ValueError('Bad integer attribute (line): %s' % exp)
         if attrs.get('bodyend'):
             try:
                 self.bodyend = int(attrs.get('bodyend').value)
-            except ValueError, exp:
+            except ValueError as exp:
                 raise ValueError('Bad integer attribute (bodyend): %s' % exp)
         if attrs.get('bodyfile'):
             self.bodyfile = attrs.get('bodyfile').value
@@ -6778,12 +6779,12 @@ class docTableType(GeneratedsSuper):
         if attrs.get('rows'):
             try:
                 self.rows = int(attrs.get('rows').value)
-            except ValueError, exp:
+            except ValueError as exp:
                 raise ValueError('Bad integer attribute (rows): %s' % exp)
         if attrs.get('cols'):
             try:
                 self.cols = int(attrs.get('cols').value)
-            except ValueError, exp:
+            except ValueError as exp:
                 raise ValueError('Bad integer attribute (cols): %s' % exp)
     def buildChildren(self, child_, nodeName_):
         if child_.nodeType == Node.ELEMENT_NODE and \
@@ -7108,7 +7109,7 @@ class docHeadingType(GeneratedsSuper):
         if attrs.get('level'):
             try:
                 self.level = int(attrs.get('level').value)
-            except ValueError, exp:
+            except ValueError as exp:
                 raise ValueError('Bad integer attribute (level): %s' % exp)
     def buildChildren(self, child_, nodeName_):
         if child_.nodeType == Node.TEXT_NODE:
@@ -8283,7 +8284,7 @@ Options:
 """
 
 def usage():
-    print USAGE_TEXT
+    print(USAGE_TEXT)
     sys.exit(1)
 
 
diff --git 
a/gr-utils/python/modtool/gr-newmod/docs/doxygen/doxyxml/generated/index.py 
b/gr-utils/python/modtool/gr-newmod/docs/doxygen/doxyxml/generated/index.py
index 91c0927..ce99a1a 100644
--- a/gr-utils/python/modtool/gr-newmod/docs/doxygen/doxyxml/generated/index.py
+++ b/gr-utils/python/modtool/gr-newmod/docs/doxygen/doxyxml/generated/index.py
@@ -3,6 +3,7 @@
 """
 Generated Mon Feb  9 19:08:05 2009 by generateDS.py.
 """
+from __future__ import absolute_import
 
 from xml.dom import minidom
 
@@ -10,7 +11,7 @@ import os
 import sys
 from . import compound
 
-import indexsuper as supermod
+from . import indexsuper as supermod
 
 class DoxygenTypeSub(supermod.DoxygenType):
     def __init__(self, version=None, compound=None):
diff --git 
a/gr-utils/python/modtool/gr-newmod/docs/doxygen/doxyxml/generated/indexsuper.py
 
b/gr-utils/python/modtool/gr-newmod/docs/doxygen/doxyxml/generated/indexsuper.py
index 2fc4cd3..4b2bd6c 100644
--- 
a/gr-utils/python/modtool/gr-newmod/docs/doxygen/doxyxml/generated/indexsuper.py
+++ 
b/gr-utils/python/modtool/gr-newmod/docs/doxygen/doxyxml/generated/indexsuper.py
@@ -4,6 +4,7 @@
 # Generated Thu Jun 11 18:43:54 2009 by generateDS.py.
 #
 
+from __future__ import print_function
 import sys
 import getopt
 
@@ -19,7 +20,7 @@ from xml.dom import Node
 
 try:
     from generatedssuper import GeneratedsSuper
-except ImportError, exp:
+except ImportError as exp:
 
     class GeneratedsSuper:
         def format_string(self, input_data, input_name=''):
@@ -462,7 +463,7 @@ Options:
 """
 
 def usage():
-    print USAGE_TEXT
+    print(USAGE_TEXT)
     sys.exit(1)
 
 
diff --git a/gr-utils/python/modtool/gr-newmod/python/build_utils.py 
b/gr-utils/python/modtool/gr-newmod/python/build_utils.py
index cf58a97..938c63b 100644
--- a/gr-utils/python/modtool/gr-newmod/python/build_utils.py
+++ b/gr-utils/python/modtool/gr-newmod/python/build_utils.py
@@ -21,15 +21,16 @@
 
 """Misc utilities used at build time
 """
+from __future__ import absolute_import
 
 import re, os, os.path
-from build_utils_codes import *
+from .build_utils_codes import *
 
 
 # set srcdir to the directory that contains Makefile.am
 try:
     srcdir = os.environ['srcdir']
-except KeyError, e:
+except KeyError as e:
     srcdir = "."
 srcdir = srcdir + '/'
 
@@ -39,7 +40,7 @@ try:
         do_makefile = False
     else:
         do_makefile = True
-except KeyError, e:
+except KeyError as e:
     do_makefile = False
 
 # set do_sources to either true or false dependeing on the environment
@@ -48,7 +49,7 @@ try:
         do_sources = False
     else:
         do_sources = True
-except KeyError, e:
+except KeyError as e:
     do_sources = True
 
 name_dict = {}
@@ -127,7 +128,7 @@ def extract_extension (template_name):
     # we return everything between the penultimate . and .t
     mo = re.search (r'\.([a-z]+)\.t$', template_name)
     if not mo:
-        raise ValueError, "Incorrectly formed template_name '%s'" % 
(template_name,)
+        raise ValueError("Incorrectly formed template_name '%s'" % 
(template_name,))
     return mo.group (1)
 
 def open_src (name, mode):
diff --git a/gr-utils/python/modtool/grc_xml_generator.py 
b/gr-utils/python/modtool/grc_xml_generator.py
index af17ca1..1109701 100644
--- a/gr-utils/python/modtool/grc_xml_generator.py
+++ b/gr-utils/python/modtool/grc_xml_generator.py
@@ -1,3 +1,4 @@
+from __future__ import absolute_import
 #
 # Copyright 2013 Free Software Foundation, Inc.
 #
@@ -19,7 +20,7 @@
 # Boston, MA 02110-1301, USA.
 #
 import xml.etree.ElementTree as ET
-from util_functions import is_number, xml_indent
+from .util_functions import is_number, xml_indent
 
 try:
     import lxml.etree
diff --git a/gr-utils/python/modtool/modtool_add.py 
b/gr-utils/python/modtool/modtool_add.py
index 825be0f..338e921 100644
--- a/gr-utils/python/modtool/modtool_add.py
+++ b/gr-utils/python/modtool/modtool_add.py
@@ -21,15 +21,16 @@
 """ Module to add new blocks """
 
 from __future__ import print_function
+from __future__ import absolute_import
 
 import os
 import re
 
-from util_functions import append_re_line_sequence, ask_yes_no
-from cmakefile_editor import CMakeFileEditor
-from modtool_base import ModTool, ModToolException
-from templates import Templates
-from code_generator import render_template
+from .util_functions import append_re_line_sequence, ask_yes_no
+from .cmakefile_editor import CMakeFileEditor
+from .modtool_base import ModTool, ModToolException
+from .templates import Templates
+from .code_generator import render_template
 
 class ModToolAdd(ModTool):
     """ Add block to the out-of-tree module. """
diff --git a/gr-utils/python/modtool/modtool_base.py 
b/gr-utils/python/modtool/modtool_base.py
index 8585111..0ac5394 100644
--- a/gr-utils/python/modtool/modtool_base.py
+++ b/gr-utils/python/modtool/modtool_base.py
@@ -21,14 +21,15 @@
 """ Base class for the modules """
 
 from __future__ import print_function
+from __future__ import absolute_import
 
 import os
 import re
 from argparse import ArgumentParser, RawDescriptionHelpFormatter
 
 from gnuradio import gr
-from util_functions import get_modname
-from scm import SCMRepoFactory
+from .util_functions import get_modname
+from .scm import SCMRepoFactory
 
 class ModToolException(BaseException):
     """ Standard exception for modtool classes. """
diff --git a/gr-utils/python/modtool/modtool_disable.py 
b/gr-utils/python/modtool/modtool_disable.py
index 2c75ca5..477560d 100644
--- a/gr-utils/python/modtool/modtool_disable.py
+++ b/gr-utils/python/modtool/modtool_disable.py
@@ -21,13 +21,14 @@
 """ Disable blocks module """
 
 from __future__ import print_function
+from __future__ import absolute_import
 
 import os
 import re
 import sys
 
-from modtool_base import ModTool
-from cmakefile_editor import CMakeFileEditor
+from .modtool_base import ModTool
+from .cmakefile_editor import CMakeFileEditor
 
 
 class ModToolDisable(ModTool):
diff --git a/gr-utils/python/modtool/modtool_info.py 
b/gr-utils/python/modtool/modtool_info.py
index 0a0b90f..e22d7f4 100644
--- a/gr-utils/python/modtool/modtool_info.py
+++ b/gr-utils/python/modtool/modtool_info.py
@@ -20,11 +20,12 @@
 """ Returns information about a module """
 
 from __future__ import print_function
+from __future__ import absolute_import
 
 import os
 
-from modtool_base import ModTool, ModToolException
-from util_functions import get_modname
+from .modtool_base import ModTool, ModToolException
+from .util_functions import get_modname
 
 
 class ModToolInfo(ModTool):
diff --git a/gr-utils/python/modtool/modtool_makexml.py 
b/gr-utils/python/modtool/modtool_makexml.py
index 4ebfaf7..aa43fee 100644
--- a/gr-utils/python/modtool/modtool_makexml.py
+++ b/gr-utils/python/modtool/modtool_makexml.py
@@ -21,16 +21,17 @@
 """ Automatically create XML bindings for GRC from block code """
 
 from __future__ import print_function
+from __future__ import absolute_import
 
 import os
 import re
 import glob
 
-from modtool_base import ModTool, ModToolException
-from parser_cc_block import ParserCCBlock
-from grc_xml_generator import GRCXMLGenerator
-from cmakefile_editor import CMakeFileEditor
-from util_functions import ask_yes_no
+from .modtool_base import ModTool, ModToolException
+from .parser_cc_block import ParserCCBlock
+from .grc_xml_generator import GRCXMLGenerator
+from .cmakefile_editor import CMakeFileEditor
+from .util_functions import ask_yes_no
 
 
 class ModToolMakeXML(ModTool):
diff --git a/gr-utils/python/modtool/modtool_newmod.py 
b/gr-utils/python/modtool/modtool_newmod.py
index c470cb1..1f5a31c 100644
--- a/gr-utils/python/modtool/modtool_newmod.py
+++ b/gr-utils/python/modtool/modtool_newmod.py
@@ -21,13 +21,14 @@
 """ Create a whole new out-of-tree module """
 
 from __future__ import print_function
+from __future__ import absolute_import
 
 import shutil
 import os
 import re
 from gnuradio import gr
-from modtool_base import ModTool, ModToolException
-from scm import SCMRepoFactory
+from .modtool_base import ModTool, ModToolException
+from .scm import SCMRepoFactory
 
 class ModToolNewModule(ModTool):
     """ Create a new out-of-tree module """
diff --git a/gr-utils/python/modtool/modtool_rename.py 
b/gr-utils/python/modtool/modtool_rename.py
index 8586b4f..dedcaf4 100644
--- a/gr-utils/python/modtool/modtool_rename.py
+++ b/gr-utils/python/modtool/modtool_rename.py
@@ -21,14 +21,15 @@
 """ Module to rename blocks """
 
 from __future__ import print_function
+from __future__ import absolute_import
 
 import os
 import re
 
-from util_functions import append_re_line_sequence, ask_yes_no
-from cmakefile_editor import CMakeFileEditor
-from modtool_base import ModTool, ModToolException
-from templates import Templates
+from .util_functions import append_re_line_sequence, ask_yes_no
+from .cmakefile_editor import CMakeFileEditor
+from .modtool_base import ModTool, ModToolException
+from .templates import Templates
 
 class ModToolRename(ModTool):
     """ Rename a block in the out-of-tree module. """
diff --git a/gr-utils/python/modtool/modtool_rm.py 
b/gr-utils/python/modtool/modtool_rm.py
index 8d5a07a..3c26f19 100644
--- a/gr-utils/python/modtool/modtool_rm.py
+++ b/gr-utils/python/modtool/modtool_rm.py
@@ -21,15 +21,16 @@
 """ Remove blocks module """
 
 from __future__ import print_function
+from __future__ import absolute_import
 
 import os
 import re
 import sys
 import glob
 
-from util_functions import remove_pattern_from_file
-from modtool_base import ModTool
-from cmakefile_editor import CMakeFileEditor
+from .util_functions import remove_pattern_from_file
+from .modtool_base import ModTool
+from .cmakefile_editor import CMakeFileEditor
 
 
 class ModToolRemove(ModTool):
diff --git a/gr-vocoder/python/vocoder/__init__.py 
b/gr-vocoder/python/vocoder/__init__.py
index 7b1b82f..e4a2012 100644
--- a/gr-vocoder/python/vocoder/__init__.py
+++ b/gr-vocoder/python/vocoder/__init__.py
@@ -23,6 +23,7 @@
 This is the gr-vocoder package. This package includes the various
 vocoder blocks in GNU Radio.
 '''
+from __future__ import absolute_import
 import os
 
 try:
@@ -32,4 +33,4 @@ except ImportError:
     __path__.append(os.path.join(dirname, "..", "..", "swig"))
     from vocoder_swig import *
 
-from cvsd import *
+from .cvsd import *
diff --git a/gr-wavelet/python/wavelet/qa_classify.py 
b/gr-wavelet/python/wavelet/qa_classify.py
index 4752620..d1816cd 100755
--- a/gr-wavelet/python/wavelet/qa_classify.py
+++ b/gr-wavelet/python/wavelet/qa_classify.py
@@ -158,8 +158,8 @@ class test_classify(gr_unittest.TestCase):
         scl = 1.0/sqr(dwav[0])
         k = 1
         for e in range(len(wvps)):
-            wvps[e] = scl*sqr(dwav[k:k+(01<<e)]).sum()
-            k += 01<<e
+            wvps[e] = scl*sqr(dwav[k:k+(0o1<<e)]).sum()
+            k += 0o1<<e
 
         src = blocks.vector_source_f(src_data, False, len(src_data))
         kon = wavelet.wvps_ff(len(src_data))
diff --git a/gr-zeromq/examples/python/client.py 
b/gr-zeromq/examples/python/client.py
index ca7ad18..b48b790 100755
--- a/gr-zeromq/examples/python/client.py
+++ b/gr-zeromq/examples/python/client.py
@@ -1,3 +1,4 @@
+from __future__ import print_function
 #
 # Copyright 2013 Free Software Foundation, Inc.
 #
@@ -67,14 +68,14 @@ class top_block(gr.top_block):
         self.rpc_manager.start_watcher()
 
     def start_fg(self):
-        print "Start Flowgraph"
+        print("Start Flowgraph")
         try:
             self.start()
         except RuntimeError:
-            print "Can't start, flowgraph already running!"
+            print("Can't start, flowgraph already running!")
 
     def stop_fg(self):
-        print "Stop Flowgraph"
+        print("Stop Flowgraph")
         self.stop()
         self.wait()
 
@@ -110,7 +111,7 @@ if __name__ == "__main__":
             time.sleep(1)
     except KeyboardInterrupt:
         pass
-    print "Shutting down flowgraph."
+    print("Shutting down flowgraph.")
     tb.rpc_manager.stop_watcher()
     tb.stop()
     tb.wait()
diff --git a/gr-zeromq/examples/python/server.py 
b/gr-zeromq/examples/python/server.py
index 2395166..767590d 100755
--- a/gr-zeromq/examples/python/server.py
+++ b/gr-zeromq/examples/python/server.py
@@ -1,3 +1,4 @@
+from __future__ import print_function
 #
 # Copyright 2013 Free Software Foundation, Inc.
 #
@@ -78,14 +79,14 @@ class top_block(gr.top_block):
         self.rpc_manager.start_watcher()
 
     def start_fg(self):
-        print "Start Flowgraph"
+        print("Start Flowgraph")
         try:
             self.start()
         except RuntimeError:
-            print "Can't start, flowgraph already running!"
+            print("Can't start, flowgraph already running!")
 
     def stop_fg(self):
-        print "Stop Flowgraph"
+        print("Stop Flowgraph")
         self.stop()
         self.wait()
 
@@ -119,7 +120,7 @@ if __name__ == "__main__":
             time.sleep(1)
     except KeyboardInterrupt:
         pass
-    print "Shutting down flowgraph."
+    print("Shutting down flowgraph.")
     tb.rpc_manager.stop_watcher()
     tb.stop()
     tb.wait()
diff --git a/gr-zeromq/python/zeromq/__init__.py 
b/gr-zeromq/python/zeromq/__init__.py
index cab4b67..487382a 100644
--- a/gr-zeromq/python/zeromq/__init__.py
+++ b/gr-zeromq/python/zeromq/__init__.py
@@ -22,6 +22,7 @@
 '''
 Blocks for interfacing with ZeroMQ endpoints.
 '''
+from __future__ import absolute_import
 
 import os
 
@@ -32,5 +33,5 @@ except ImportError:
     __path__.append(os.path.join(dirname, "..", "..", "swig"))
     from zeromq_swig import *
 
-from probe_manager import probe_manager
-from rpc_manager import rpc_manager
+from .probe_manager import probe_manager
+from .rpc_manager import rpc_manager
diff --git a/gr-zeromq/python/zeromq/rpc_manager.py 
b/gr-zeromq/python/zeromq/rpc_manager.py
index d766490..8b1d685 100644
--- a/gr-zeromq/python/zeromq/rpc_manager.py
+++ b/gr-zeromq/python/zeromq/rpc_manager.py
@@ -52,7 +52,7 @@ class rpc_manager():
         self.poller_req_in.register(self.req_socket, zmq.POLLIN)
 
     def add_interface(self, id_str, callback_func):
-        if not self.interfaces.has_key(id_str):
+        if id_str not in self.interfaces:
             self.interfaces[id_str] = callback_func
             print("[RPC] added reply interface:", id_str)
         else:
@@ -91,7 +91,7 @@ class rpc_manager():
             return reply
 
     def callback(self, id_str, args):
-        if self.interfaces.has_key(id_str):
+        if id_str in self.interfaces:
             callback_func = self.interfaces.get(id_str)
             if not args == None:
                 # use unpacking or splat operator * to unpack argument list
diff --git a/grc/core/FlowGraph.py b/grc/core/FlowGraph.py
index ecae11c..6f31870 100644
--- a/grc/core/FlowGraph.py
+++ b/grc/core/FlowGraph.py
@@ -1,3 +1,4 @@
+from __future__ import print_function
 # Copyright 2008-2015 Free Software Foundation, Inc.
 # This file is part of GNU Radio
 #
@@ -239,14 +240,14 @@ class FlowGraph(Element):
         # Load imports
         for expr in self.get_imports():
             try:
-                exec expr in namespace
+                exec(expr, namespace)
             except:
                 pass
 
         for id, expr in self.get_python_modules():
             try:
                 module = imp.new_module(id)
-                exec expr in module.__dict__
+                exec(expr, module.__dict__)
                 namespace[id] = module
             except:
                 pass
diff --git a/grc/core/Param.py b/grc/core/Param.py
index fd098b7..d0c849c 100644
--- a/grc/core/Param.py
+++ b/grc/core/Param.py
@@ -366,7 +366,7 @@ class Param(Element):
         self._evaluated = None
         try:
             self._evaluated = self.evaluate()
-        except Exception, e:
+        except Exception as e:
             self.add_error_message(str(e))
 
     def get_evaluated(self):
@@ -399,7 +399,7 @@ class Param(Element):
             # Raise exception if python cannot evaluate this value
             try:
                 e = self.get_parent().get_parent().evaluate(v)
-            except Exception, e:
+            except Exception as e:
                 raise Exception('Value "{}" cannot be 
evaluated:\n{}'.format(v, e))
             # Raise an exception if the data is invalid
             if t == 'raw':
@@ -434,7 +434,7 @@ class Param(Element):
             # Raise exception if python cannot evaluate this value
             try:
                 e = self.get_parent().get_parent().evaluate(v)
-            except Exception, e:
+            except Exception as e:
                 raise Exception('Value "{}" cannot be 
evaluated:\n{}'.format(v, e))
             # Raise an exception if the data is invalid
             if t == 'complex_vector':
@@ -552,7 +552,7 @@ class Param(Element):
             # New namespace
             n = dict()
             try:
-                exec v in n
+                exec(v, n)
             except ImportError:
                 raise Exception('Import "{}" failed.'.format(v))
             except Exception:
diff --git a/grc/core/Platform.py b/grc/core/Platform.py
index b73dade..aaffd24 100644
--- a/grc/core/Platform.py
+++ b/grc/core/Platform.py
@@ -16,6 +16,7 @@ You should have received a copy of the GNU General Public 
License
 along with this program; if not, write to the Free Software
 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA
 """
+from __future__ import print_function
 
 import os
 import sys
@@ -155,7 +156,7 @@ class Platform(Element):
                 # print >> sys.stderr, 'Warning: Block validation 
failed:\n\t%s\n\tIgnoring: %s' % (e, xml_file)
                 pass
             except Exception as e:
-                print >> sys.stderr, 'Warning: XML parsing 
failed:\n\t%r\n\tIgnoring: %s' % (e, xml_file)
+                print('Warning: XML parsing failed:\n\t%r\n\tIgnoring: %s' % 
(e, xml_file), file=sys.stderr)
 
         # Add blocks to block tree
         for key, block in self.blocks.iteritems():
@@ -193,7 +194,7 @@ class Platform(Element):
         block = self.Block(self._flow_graph, n)
         key = block.get_key()
         if key in self.blocks:
-            print >> sys.stderr, 'Warning: Block with key "{}" already 
exists.\n\tIgnoring: {}'.format(key, xml_file)
+            print('Warning: Block with key "{}" already exists.\n\tIgnoring: 
{}'.format(key, xml_file), file=sys.stderr)
         else:  # Store the block
             self.blocks[key] = block
             self._blocks_n[key] = n
@@ -228,10 +229,10 @@ class Platform(Element):
 
         key = n.find('key')
         if not key:
-            print >> sys.stderr, 'Warning: Domain with emtpy key.\n\tIgnoring: 
{}'.format(xml_file)
+            print('Warning: Domain with emtpy key.\n\tIgnoring: 
{}'.format(xml_file), file=sys.stderr)
             return
         if key in self.domains:  # test against repeated keys
-            print >> sys.stderr, 'Warning: Domain with key "{}" already 
exists.\n\tIgnoring: {}'.format(key, xml_file)
+            print('Warning: Domain with key "{}" already exists.\n\tIgnoring: 
{}'.format(key, xml_file), file=sys.stderr)
             return
 
         #to_bool = lambda s, d: d if s is None else s.lower() not in ('false', 
'off', '0', '')
@@ -246,7 +247,7 @@ class Platform(Element):
             gtk.gdk.color_parse(color)
         except (ValueError, ImportError):
             if color:  # no color is okay, default set in GUI
-                print >> sys.stderr, 'Warning: Can\'t parse color code "{}" 
for domain "{}" '.format(color, key)
+                print('Warning: Can\'t parse color code "{}" for domain "{}" 
'.format(color, key), file=sys.stderr)
                 color = None
 
         self.domains[key] = dict(
@@ -258,9 +259,9 @@ class Platform(Element):
         for connection_n in n.findall('connection'):
             key = (connection_n.find('source_domain'), 
connection_n.find('sink_domain'))
             if not all(key):
-                print >> sys.stderr, 'Warning: Empty domain key(s) in 
connection template.\n\t{}'.format(xml_file)
+                print('Warning: Empty domain key(s) in connection 
template.\n\t{}'.format(xml_file), file=sys.stderr)
             elif key in self.connection_templates:
-                print >> sys.stderr, 'Warning: Connection template "{}" 
already exists.\n\t{}'.format(key, xml_file)
+                print('Warning: Connection template "{}" already 
exists.\n\t{}'.format(key, xml_file), file=sys.stderr)
             else:
                 self.connection_templates[key] = connection_n.find('make') or 
''
 
diff --git a/grc/core/generator/__init__.py b/grc/core/generator/__init__.py
index f44b94a..8e54988 100644
--- a/grc/core/generator/__init__.py
+++ b/grc/core/generator/__init__.py
@@ -1,3 +1,4 @@
+from __future__ import absolute_import
 # Copyright 2008-2015 Free Software Foundation, Inc.
 # This file is part of GNU Radio
 #
@@ -15,4 +16,4 @@
 # along with this program; if not, write to the Free Software
 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, 
USA
 
-from Generator import Generator
+from .Generator import Generator
diff --git a/grc/core/utils/__init__.py b/grc/core/utils/__init__.py
index 6b23da2..acdd294 100644
--- a/grc/core/utils/__init__.py
+++ b/grc/core/utils/__init__.py
@@ -1,3 +1,4 @@
+from __future__ import absolute_import
 # Copyright 2008-2015 Free Software Foundation, Inc.
 # This file is part of GNU Radio
 #
@@ -15,8 +16,8 @@
 # along with this program; if not, write to the Free Software
 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, 
USA
 
-import expr_utils
-import epy_block_io
-import extract_docs
+from . import expr_utils
+from . import epy_block_io
+from . import extract_docs
 
-from odict import odict
+from .odict import odict
diff --git a/grc/core/utils/epy_block_io.py b/grc/core/utils/epy_block_io.py
index a094ab7..a1797e8 100644
--- a/grc/core/utils/epy_block_io.py
+++ b/grc/core/utils/epy_block_io.py
@@ -32,7 +32,7 @@ def _ports(sigs, msgs):
 def _find_block_class(source_code, cls):
     ns = {}
     try:
-        exec source_code in ns
+        exec(source_code, ns)
     except Exception as e:
         raise ValueError("Can't interpret source code: " + str(e))
     for var in ns.itervalues():
diff --git a/grc/core/utils/extract_docs.py b/grc/core/utils/extract_docs.py
index a6e0bc9..00abac8 100644
--- a/grc/core/utils/extract_docs.py
+++ b/grc/core/utils/extract_docs.py
@@ -16,6 +16,7 @@ You should have received a copy of the GNU General Public 
License
 along with this program; if not, write to the Free Software
 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA
 """
+from __future__ import print_function
 
 import sys
 import re
@@ -157,14 +158,14 @@ class SubprocessLoader(object):
                 cmd, args = self._last_cmd
                 if cmd == 'query':
                     msg += " (crashed while loading {0!r})".format(args[0])
-                print >> sys.stderr, msg
+                print(msg, file=sys.stderr)
                 continue  # restart
             else:
                 break  # normal termination, return
             finally:
                 self._worker.terminate()
         else:
-            print >> sys.stderr, "Warning: docstring loader crashed too often"
+            print("Warning: docstring loader crashed too often", 
file=sys.stderr)
         self._thread = None
         self._worker = None
         self.callback_finished()
@@ -203,9 +204,9 @@ class SubprocessLoader(object):
             key, docs = args
             self.callback_query_result(key, docs)
         elif cmd == 'error':
-            print args
+            print(args)
         else:
-            print >> sys.stderr, "Unknown response:", cmd, args
+            print("Unknown response:", cmd, args, file=sys.stderr)
 
     def query(self, key, imports=None, make=None):
         """ Request docstring extraction for a certain key """
@@ -270,12 +271,12 @@ if __name__ == '__worker__':
 
 elif __name__ == '__main__':
     def callback(key, docs):
-        print key
+        print(key)
         for match, doc in docs.iteritems():
-            print '-->', match
-            print doc.strip()
-            print
-        print
+            print('-->', match)
+            print(doc.strip())
+            print()
+        print()
 
     r = SubprocessLoader(callback)
 
diff --git a/grc/gui/ActionHandler.py b/grc/gui/ActionHandler.py
index b9f534f..c13c900 100644
--- a/grc/gui/ActionHandler.py
+++ b/grc/gui/ActionHandler.py
@@ -16,6 +16,7 @@ You should have received a copy of the GNU General Public 
License
 along with this program; if not, write to the Free Software
 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA
 """
+from __future__ import print_function
 
 
 import gobject
@@ -601,7 +602,7 @@ class ActionHandler:
                 try:
                     page.get_proc().kill()
                 except:
-                    print "could not kill process: %d" % page.get_proc().pid
+                    print("could not kill process: %d" % page.get_proc().pid)
         elif action == Actions.PAGE_CHANGE:  # pass and run the global actions
             pass
         elif action == Actions.RELOAD_BLOCKS:
@@ -642,7 +643,7 @@ class ActionHandler:
                              shell=True, stdout=subprocess.PIPE, 
stderr=subprocess.STDOUT)
 
         else:
-            print '!!! Action "%s" not handled !!!' % action
+            print('!!! Action "%s" not handled !!!' % action)
         ##################################################
         # Global Actions for all States
         ##################################################
diff --git a/grc/gui/Actions.py b/grc/gui/Actions.py
index 9b2af36..31579ad 100644
--- a/grc/gui/Actions.py
+++ b/grc/gui/Actions.py
@@ -16,12 +16,14 @@ You should have received a copy of the GNU General Public 
License
 along with this program; if not, write to the Free Software
 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA
 """
+from __future__ import absolute_import
 
 import pygtk
+from functools import reduce
 pygtk.require('2.0')
 import gtk
 
-import Preferences
+from . import Preferences
 
 NO_MODS_MASK = 0
 
@@ -81,7 +83,7 @@ class _ActionBase(object):
         for i in range(len(keypresses)/2):
             keyval, mod_mask = keypresses[i*2:(i+1)*2]
             # register this keypress
-            if _actions_keypress_dict.has_key((keyval, mod_mask)):
+            if (keyval, mod_mask) in _actions_keypress_dict:
                 raise KeyError('keyval/mod_mask pair already registered "%s"' 
% str((keyval, mod_mask)))
             _actions_keypress_dict[(keyval, mod_mask)] = self
             # set the accelerator group, and accelerator path
diff --git a/grc/gui/Bars.py b/grc/gui/Bars.py
index a4819b9..2b93c80 100644
--- a/grc/gui/Bars.py
+++ b/grc/gui/Bars.py
@@ -16,6 +16,7 @@ You should have received a copy of the GNU General Public 
License
 along with this program; if not, write to the Free Software
 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA
 """
+from __future__ import absolute_import
 
 import pygtk
 pygtk.require('2.0')
@@ -203,7 +204,7 @@ class SubMenuCreator(object):
 
     def _fill_flow_graph_recent_submenu(self, action):
         """menu showing recent flow-graphs"""
-        import Preferences
+        from . import Preferences
         menu = gtk.Menu()
         recent_files = Preferences.get_recent_files()
         if len(recent_files) > 0:
diff --git a/grc/gui/Colors.py b/grc/gui/Colors.py
index d322afa..9b366aa 100644
--- a/grc/gui/Colors.py
+++ b/grc/gui/Colors.py
@@ -16,6 +16,7 @@ You should have received a copy of the GNU General Public 
License
 along with this program; if not, write to the Free Software
 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA
 """
+from __future__ import print_function
 try:
     import pygtk
     pygtk.require('2.0')
@@ -45,6 +46,6 @@ try:
     CONNECTION_DISABLED_COLOR = get_color('#BBBBBB')
     CONNECTION_ERROR_COLOR = get_color('red')
 except:
-    print 'Unable to import Colors'
+    print('Unable to import Colors')
 
 DEFAULT_DOMAIN_COLOR_CODE = '#777777'
diff --git a/grc/gui/Config.py b/grc/gui/Config.py
index 9b0c5d4..56424b9 100644
--- a/grc/gui/Config.py
+++ b/grc/gui/Config.py
@@ -16,6 +16,7 @@ You should have received a copy of the GNU General Public 
License
 along with this program; if not, write to the Free Software
 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA
 """
+from __future__ import print_function
 
 import sys
 import os
@@ -57,7 +58,7 @@ class Config(_Config):
                 raise Exception()
             return value
         except:
-            print >> sys.stderr, "Error: invalid 'canvas_default_size' 
setting."
+            print("Error: invalid 'canvas_default_size' setting.", 
file=sys.stderr)
             return Constants.DEFAULT_CANVAS_SIZE_DEFAULT
 
     @property
@@ -69,6 +70,6 @@ class Config(_Config):
                 raise Exception()
         except:
             font_size = Constants.DEFAULT_FONT_SIZE
-            print >> sys.stderr, "Error: invalid 'canvas_font_size' setting."
+            print("Error: invalid 'canvas_font_size' setting.", 
file=sys.stderr)
 
         return font_size
diff --git a/grc/gui/Connection.py b/grc/gui/Connection.py
index 50361c1..d551d19 100644
--- a/grc/gui/Connection.py
+++ b/grc/gui/Connection.py
@@ -16,13 +16,14 @@ You should have received a copy of the GNU General Public 
License
 along with this program; if not, write to the Free Software
 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA
 """
+from __future__ import absolute_import
 
 import gtk
 
-import Colors
-import Utils
-from Constants import CONNECTOR_ARROW_BASE, CONNECTOR_ARROW_HEIGHT
-from Element import Element
+from . import Colors
+from . import Utils
+from .Constants import CONNECTOR_ARROW_BASE, CONNECTOR_ARROW_HEIGHT
+from .Element import Element
 
 from ..core.Constants import GR_MESSAGE_DOMAIN
 from ..core.Connection import Connection as _Connection
diff --git a/grc/gui/DrawingArea.py b/grc/gui/DrawingArea.py
index 6a1df27..24d1071 100644
--- a/grc/gui/DrawingArea.py
+++ b/grc/gui/DrawingArea.py
@@ -16,13 +16,14 @@ You should have received a copy of the GNU General Public 
License
 along with this program; if not, write to the Free Software
 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA
 """
+from __future__ import absolute_import
 
 import pygtk
 pygtk.require('2.0')
 import gtk
 
-from Constants import MIN_WINDOW_WIDTH, MIN_WINDOW_HEIGHT, DND_TARGETS
-import Colors
+from .Constants import MIN_WINDOW_WIDTH, MIN_WINDOW_HEIGHT, DND_TARGETS
+from . import Colors
 
 
 class DrawingArea(gtk.DrawingArea):
diff --git a/grc/gui/Element.py b/grc/gui/Element.py
index 9385424..34c0552 100644
--- a/grc/gui/Element.py
+++ b/grc/gui/Element.py
@@ -16,9 +16,10 @@ You should have received a copy of the GNU General Public 
License
 along with this program; if not, write to the Free Software
 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA
 """
+from __future__ import absolute_import
 
-from Constants import LINE_SELECT_SENSITIVITY
-from Constants import POSSIBLE_ROTATIONS
+from .Constants import LINE_SELECT_SENSITIVITY
+from .Constants import POSSIBLE_ROTATIONS
 
 import gtk
 
diff --git a/grc/gui/FileDialogs.py b/grc/gui/FileDialogs.py
index 9d047b1..417ce7e 100644
--- a/grc/gui/FileDialogs.py
+++ b/grc/gui/FileDialogs.py
@@ -16,17 +16,18 @@ You should have received a copy of the GNU General Public 
License
 along with this program; if not, write to the Free Software
 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA
 """
+from __future__ import absolute_import
 
 import pygtk
 pygtk.require('2.0')
 import gtk
-from Dialogs import MessageDialogHelper
-from Constants import \
+from .Dialogs import MessageDialogHelper
+from .Constants import \
     DEFAULT_FILE_PATH, IMAGE_FILE_EXTENSION, TEXT_FILE_EXTENSION, \
     NEW_FLOGRAPH_TITLE
-import Preferences
+from . import Preferences
 from os import path
-import Utils
+from . import Utils
 
 ##################################################
 # Constants
diff --git a/grc/gui/MainWindow.py b/grc/gui/MainWindow.py
index 686e73c..d5e49c6 100644
--- a/grc/gui/MainWindow.py
+++ b/grc/gui/MainWindow.py
@@ -272,7 +272,7 @@ class MainWindow(gtk.Window):
                 file_path=file_path,
             )
             if file_path: Messages.send_end_load()
-        except Exception, e: #return on failure
+        except Exception as e: #return on failure
             Messages.send_fail_load(e)
             if isinstance(e, KeyError) and str(e) == "'options'":
                 # This error is unrecoverable, so crash gracefully
diff --git a/grc/gui/NotebookPage.py b/grc/gui/NotebookPage.py
index c9e8d0f..874a027 100644
--- a/grc/gui/NotebookPage.py
+++ b/grc/gui/NotebookPage.py
@@ -16,14 +16,15 @@ You should have received a copy of the GNU General Public 
License
 along with this program; if not, write to the Free Software
 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA
 """
+from __future__ import absolute_import
 
 import pygtk
 pygtk.require('2.0')
 import gtk
-import Actions
-from StateCache import StateCache
-from Constants import MIN_WINDOW_WIDTH, MIN_WINDOW_HEIGHT
-from DrawingArea import DrawingArea
+from . import Actions
+from .StateCache import StateCache
+from .Constants import MIN_WINDOW_WIDTH, MIN_WINDOW_HEIGHT
+from .DrawingArea import DrawingArea
 import os
 
 
diff --git a/grc/gui/ParserErrorsDialog.py b/grc/gui/ParserErrorsDialog.py
index 68ee459..2d36f60 100644
--- a/grc/gui/ParserErrorsDialog.py
+++ b/grc/gui/ParserErrorsDialog.py
@@ -16,12 +16,13 @@ You should have received a copy of the GNU General Public 
License
 along with this program; if not, write to the Free Software
 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA
 """
+from __future__ import absolute_import
 
 import pygtk
 pygtk.require('2.0')
 import gtk
 
-from Constants import MIN_DIALOG_WIDTH, MIN_DIALOG_HEIGHT
+from .Constants import MIN_DIALOG_WIDTH, MIN_DIALOG_HEIGHT
 
 
 class ParserErrorsDialog(gtk.Dialog):
diff --git a/grc/gui/Platform.py b/grc/gui/Platform.py
index 500df1c..b1c5d6f 100644
--- a/grc/gui/Platform.py
+++ b/grc/gui/Platform.py
@@ -16,6 +16,7 @@ You should have received a copy of the GNU General Public 
License
 along with this program; if not, write to the Free Software
 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA
 """
+from __future__ import print_function
 
 import os
 import sys
@@ -58,7 +59,7 @@ class Platform(Element, _Platform):
                 import shutil
                 shutil.move(old_gui_prefs_file, gui_prefs_file)
             except Exception as e:
-                print >> sys.stderr, e
+                print(e, file=sys.stderr)
 
     ##############################################
     # Constructors
diff --git a/grc/gui/Preferences.py b/grc/gui/Preferences.py
index d377018..f9af586 100644
--- a/grc/gui/Preferences.py
+++ b/grc/gui/Preferences.py
@@ -16,6 +16,7 @@ You should have received a copy of the GNU General Public 
License
 along with this program; if not, write to the Free Software
 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA
 """
+from __future__ import print_function
 
 import os
 import sys
@@ -45,12 +46,12 @@ def load(platform):
     for section in ['main', 'files_open', 'files_recent']:
         try:
             _config_parser.add_section(section)
-        except Exception, e:
-             print e
+        except Exception as e:
+             print(e)
     try:
         _config_parser.read(_platform.get_prefs_file())
     except Exception as err:
-        print >> sys.stderr, err
+        print(err, file=sys.stderr)
 
 
 def save():
@@ -59,7 +60,7 @@ def save():
             fp.write(HEADER)
             _config_parser.write(fp)
     except Exception as err:
-        print >> sys.stderr, err
+        print(err, file=sys.stderr)
 
 
 def entry(key, value=None, default=None):
diff --git a/grc/gui/PropsDialog.py b/grc/gui/PropsDialog.py
index a5b46cb..6f12abf 100644
--- a/grc/gui/PropsDialog.py
+++ b/grc/gui/PropsDialog.py
@@ -16,15 +16,16 @@ You should have received a copy of the GNU General Public 
License
 along with this program; if not, write to the Free Software
 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA
 """
+from __future__ import absolute_import
 
 import pygtk
 pygtk.require('2.0')
 import gtk
 
-import Actions
-from Dialogs import SimpleTextDisplay
-from Constants import MIN_DIALOG_WIDTH, MIN_DIALOG_HEIGHT, FONT_SIZE
-import Utils
+from . import Actions
+from .Dialogs import SimpleTextDisplay
+from .Constants import MIN_DIALOG_WIDTH, MIN_DIALOG_HEIGHT, FONT_SIZE
+from . import Utils
 import pango
 
 TAB_LABEL_MARKUP_TMPL="""\
diff --git a/grc/gui/StateCache.py b/grc/gui/StateCache.py
index 3cdb5f3..1581d8d 100644
--- a/grc/gui/StateCache.py
+++ b/grc/gui/StateCache.py
@@ -16,9 +16,10 @@ You should have received a copy of the GNU General Public 
License
 along with this program; if not, write to the Free Software
 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA
 """
+from __future__ import absolute_import
 
-import Actions
-from Constants import STATE_CACHE_SIZE
+from . import Actions
+from .Constants import STATE_CACHE_SIZE
 
 class StateCache(object):
     """
diff --git a/grc/gui/Utils.py b/grc/gui/Utils.py
index 3ab8d20..3756682 100644
--- a/grc/gui/Utils.py
+++ b/grc/gui/Utils.py
@@ -16,6 +16,7 @@ You should have received a copy of the GNU General Public 
License
 along with this program; if not, write to the Free Software
 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA
 """
+from __future__ import absolute_import
 
 import pygtk
 pygtk.require('2.0')
@@ -24,7 +25,7 @@ import gobject
 
 from Cheetah.Template import Template
 
-from Constants import POSSIBLE_ROTATIONS, CANVAS_GRID_SIZE, DPI_SCALING
+from .Constants import POSSIBLE_ROTATIONS, CANVAS_GRID_SIZE, DPI_SCALING
 
 
 def rotate_pixmap(gc, src_pixmap, dst_pixmap, 
angle=gtk.gdk.PIXBUF_ROTATE_COUNTERCLOCKWISE):
@@ -73,7 +74,7 @@ def get_rotated_coordinate(coor, rotation):
     return x * cos_r + y * sin_r, -x * sin_r + y * cos_r
 
 
-def get_angle_from_coordinates((x1, y1), (x2, y2)):
+def get_angle_from_coordinates(xxx_todo_changeme, xxx_todo_changeme1):
     """
     Given two points, calculate the vector direction from point1 to point2, 
directions are multiples of 90 degrees.
 
@@ -84,6 +85,8 @@ def get_angle_from_coordinates((x1, y1), (x2, y2)):
     Returns:
         the direction in degrees
     """
+    (x1, y1) = xxx_todo_changeme
+    (x2, y2) = xxx_todo_changeme1
     if y1 == y2:  # 0 or 180
         return 0 if x2 > x1 else 180
     else:  # 90 or 270
diff --git a/grc/gui/external_editor.py b/grc/gui/external_editor.py
index 76f2141..078fc6d 100644
--- a/grc/gui/external_editor.py
+++ b/grc/gui/external_editor.py
@@ -16,6 +16,7 @@ You should have received a copy of the GNU General Public 
License
 along with this program; if not, write to the Free Software
 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA
 """
+from __future__ import print_function
 
 import os
 import sys
@@ -71,7 +72,7 @@ class ExternalEditor(threading.Thread):
                 time.sleep(1)
 
         except Exception as e:
-            print >> sys.stderr, "file monitor crashed:", str(e)
+            print("file monitor crashed:", str(e), file=sys.stderr)
         else:
             # print "file monitor: done with", filename
             pass
@@ -79,7 +80,7 @@ class ExternalEditor(threading.Thread):
 
 if __name__ == '__main__':
     def p(data):
-        print data
+        print(data)
 
     e = ExternalEditor('/usr/bin/gedit', "test", "content", p)
     e.open_editor()



reply via email to

[Prev in Thread] Current Thread [Next in Thread]