8daa4d1
diff --git a/misc/guess-ploidy.py b/misc/guess-ploidy.py
8daa4d1
index 816a5c6..6ad3d36 100755
8daa4d1
--- a/misc/guess-ploidy.py
8daa4d1
+++ b/misc/guess-ploidy.py
8daa4d1
@@ -24,6 +24,8 @@
8daa4d1
 # FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
8daa4d1
 # DEALINGS IN THE SOFTWARE.
8daa4d1
 
8daa4d1
+from __future__ import print_function
8daa4d1
+
8daa4d1
 import matplotlib as mpl
8daa4d1
 mpl.use('Agg')
8daa4d1
 import matplotlib.pyplot as plt
8daa4d1
@@ -33,8 +35,9 @@ import csv
8daa4d1
 csv.register_dialect('tab', delimiter='\t', quoting=csv.QUOTE_NONE)
8daa4d1
 
8daa4d1
 if len(sys.argv) != 3:
8daa4d1
-    print >> sys.stderr, 'About: Plot output of "bcftools +guess-ploidy -v"'
8daa4d1
-    print >> sys.stderr, 'Usage: guess-ploidy.py <guess-ploidy.out> <image-prefix>'
8daa4d1
+    print("""\
8daa4d1
+About: Plot output of "bcftools +guess-ploidy -v"
8daa4d1
+Usage: guess-ploidy.py <guess-ploidy.out> <image-prefix>""", file = sys.stderr)
8daa4d1
     sys.exit()
8daa4d1
 
8daa4d1
 prefix = sys.argv[2]
8daa4d1
diff --git a/misc/plot-roh.py b/misc/plot-roh.py
8daa4d1
index 81efaaa..90dd63e 100755
8daa4d1
--- a/misc/plot-roh.py
8daa4d1
+++ b/misc/plot-roh.py
8daa4d1
@@ -29,26 +29,27 @@ csv.register_dialect('tab', delimiter='\t', quoting=csv.QUOTE_NONE)
8daa4d1
 
8daa4d1
 def usage(msg=None):
8daa4d1
     if msg==None:
8daa4d1
-        print 'Usage: plot.py [OPTIONS] <dir>'
8daa4d1
-        print 'Options:'
8daa4d1
-        print '   -H, --highlight +group1,-group2       Highlight calls shared within group1 but not present in group2'
8daa4d1
-        print '   -i, --interactive                     Run interactively'
8daa4d1
-        print '   -l, --min-length <num>                Filter input regions shorter than this [0]'
8daa4d1
-        print '   -n, --min-markers <num>               Filter input regions with fewer marker than this [0]'
8daa4d1
-        print '   -o, --outfile <file>                  Output file name [plot.png]'
8daa4d1
-        print '   -q, --min-qual <num>                  Filter input regions with quality smaller than this [0]'
8daa4d1
-        print '   -r, --region [^]<chr|chr:beg-end>     Plot this chromosome/region only'
8daa4d1
-        print '   -s, --samples <file>                  List of samples to show, rename or group: "name[\\tnew_name[\\tgroup]]"'
8daa4d1
-        print '   -h, --help                            This usage text'
8daa4d1
-        print 'Matplotlib options:'
8daa4d1
-        print '   +adj, --adjust <str>          Set plot adjust [bottom=0.18,left=0.07,right=0.98]'
8daa4d1
-        print '   +dpi, --dpi <num>             Set bitmap DPI [150]'
8daa4d1
-        print '   +sxt, --show-xticks           Show x-ticks (genomic coordinate)'
8daa4d1
-        print '   +twh, --track-wh <num,num>    Set track width and height [20,1]'
8daa4d1
-        print '   +xlb, --xlabel <str>          Set x-label'
8daa4d1
-        print '   +xli, --xlimit <num>          Extend x-range by this fraction [0.05]'
8daa4d1
+        print("""\
8daa4d1
+Usage: plot-roh.py [OPTIONS] <dir>
8daa4d1
+Options:
8daa4d1
+   -H, --highlight +group1,-group2       Highlight calls shared within group1 but not present in group2
8daa4d1
+   -i, --interactive                     Run interactively
8daa4d1
+   -l, --min-length <num>                Filter input regions shorter than this [0]
8daa4d1
+   -n, --min-markers <num>               Filter input regions with fewer marker than this [0]
8daa4d1
+   -o, --outfile <file>                  Output file name [plot.png]
8daa4d1
+   -q, --min-qual <num>                  Filter input regions with quality smaller than this [0]
8daa4d1
+   -r, --region [^]<chr|chr:beg-end>     Plot this chromosome/region only
8daa4d1
+   -s, --samples <file>                  List of samples to show, rename or group: "name[\\tnew_name[\\tgroup]]"
8daa4d1
+   -h, --help                            This usage text
8daa4d1
+Matplotlib options:
8daa4d1
+   +adj, --adjust <str>          Set plot adjust [bottom=0.18,left=0.07,right=0.98]
8daa4d1
+   +dpi, --dpi <num>             Set bitmap DPI [150]
8daa4d1
+   +sxt, --show-xticks           Show x-ticks (genomic coordinate)
8daa4d1
+   +twh, --track-wh <num,num>    Set track width and height [20,1]
8daa4d1
+   +xlb, --xlabel <str>          Set x-label
8daa4d1
+   +xli, --xlimit <num>          Extend x-range by this fraction [0.05]""")
8daa4d1
     else:
8daa4d1
-        print msg
8daa4d1
+        print(msg)
8daa4d1
     sys.exit(1)
8daa4d1
 
8daa4d1
 dir          = None