Convert a lot of print statements to print functions in docstrings,
documentation, and unused/rarely used functions.
diff --git a/Lib/bsddb/dbrecio.py b/Lib/bsddb/dbrecio.py
index 949a3a2..6036b3a 100644
--- a/Lib/bsddb/dbrecio.py
+++ b/Lib/bsddb/dbrecio.py
@@ -158,14 +158,14 @@
     if f.getvalue() != text:
         raise RuntimeError, 'write failed'
     length = f.tell()
-    print 'File length =', length
+    print('File length =', length)
     f.seek(len(lines[0]))
     f.write(lines[1])
     f.seek(0)
-    print 'First line =', repr(f.readline())
+    print('First line =', repr(f.readline()))
     here = f.tell()
     line = f.readline()
-    print 'Second line =', repr(line)
+    print('Second line =', repr(line))
     f.seek(-len(line), 1)
     line2 = f.read(len(line))
     if line != line2:
@@ -177,8 +177,8 @@
     line2 = f.read()
     if line != line2:
         raise RuntimeError, 'bad result after seek back from EOF'
-    print 'Read', len(list), 'more lines'
-    print 'File length =', f.tell()
+    print('Read', len(list), 'more lines')
+    print('File length =', f.tell())
     if f.tell() != length:
         raise RuntimeError, 'bad length'
     f.close()
diff --git a/Lib/idlelib/PyShell.py b/Lib/idlelib/PyShell.py
index 7799232..16f9ccf 100644
--- a/Lib/idlelib/PyShell.py
+++ b/Lib/idlelib/PyShell.py
@@ -1273,7 +1273,7 @@
         Run $IDLESTARTUP or $PYTHONSTARTUP, edit foo.py, and open a shell
         window with the title "Baz".
 
-idle -c "import sys; print sys.argv" "foo"
+idle -c "import sys; print(sys.argv)" "foo"
         Open a shell window and run the command, passing "-c" in sys.argv[0]
         and "foo" in sys.argv[1].
 
@@ -1282,7 +1282,7 @@
         run foo.py, passing "foo.py" in sys.argv[0] and "Hello World" in
         sys.argv[1].
 
-echo "import sys; print sys.argv" | idle - "foobar"
+echo "import sys; print(sys.argv)" | idle - "foobar"
         Open a shell window, run the script piped in, passing '' in sys.argv[0]
         and "foobar" in sys.argv[1].
 """
diff --git a/Lib/os.py b/Lib/os.py
index b6e1570..b5ade28 100644
--- a/Lib/os.py
+++ b/Lib/os.py
@@ -254,9 +254,9 @@
     import os
     from os.path import join, getsize
     for root, dirs, files in os.walk('python/Lib/email'):
-        print root, "consumes",
-        print sum([getsize(join(root, name)) for name in files]),
-        print "bytes in", len(files), "non-directory files"
+        print(root, "consumes", end="")
+        print(sum([getsize(join(root, name)) for name in files]), end="")
+        print("bytes in", len(files), "non-directory files")
         if 'CVS' in dirs:
             dirs.remove('CVS')  # don't visit CVS directories
     """
diff --git a/Lib/pdb.py b/Lib/pdb.py
index a6355ec..d77ea28 100755
--- a/Lib/pdb.py
+++ b/Lib/pdb.py
@@ -500,7 +500,8 @@
         try:
             bp = bdb.Breakpoint.bpbynumber[bpnum]
         except IndexError:
-            print >>self.stdout, 'Breakpoint index %r is not valid' % args[0]
+            print('Breakpoint index %r is not valid' % args[0],
+                  file=self.stdout)
             return
         if bp:
             bp.cond = cond
@@ -524,7 +525,8 @@
         try:
             bp = bdb.Breakpoint.bpbynumber[bpnum]
         except IndexError:
-            print >>self.stdout, 'Breakpoint index %r is not valid' % args[0]
+            print('Breakpoint index %r is not valid' % args[0],
+                  file=self.stdout)
             return
         if bp:
             bp.ignore = count
diff --git a/Lib/test/test_global.py b/Lib/test/test_global.py
index 22e4b25..2a58a10 100644
--- a/Lib/test/test_global.py
+++ b/Lib/test/test_global.py
@@ -21,7 +21,7 @@
     def test2(self):
         prog_text_2 = """\
 def wrong2():
-    print x
+    print(x)
     global x
 """
         check_syntax_error(self, prog_text_2)
@@ -29,7 +29,7 @@
     def test3(self):
         prog_text_3 = """\
 def wrong3():
-    print x
+    print(x)
     x = 2
     global x
 """
diff --git a/Lib/test/test_popen.py b/Lib/test/test_popen.py
index 397e4a3..209bb13 100644
--- a/Lib/test/test_popen.py
+++ b/Lib/test/test_popen.py
@@ -10,7 +10,7 @@
 
 # Test that command-lines get down as we expect.
 # To do this we execute:
-#    python -c "import sys;print sys.argv" {rest_of_commandline}
+#    python -c "import sys;print(sys.argv)" {rest_of_commandline}
 # This results in Python being spawned and printing the sys.argv list.
 # We can then eval() the result of this, and see what each argv was.
 python = sys.executable
diff --git a/Lib/test/test_support.py b/Lib/test/test_support.py
index 92592eb..62d327e 100644
--- a/Lib/test/test_support.py
+++ b/Lib/test/test_support.py
@@ -481,7 +481,7 @@
     Example use (with 'stream_name=stdout')::
 
        with captured_stdout() as s:
-           print "hello"
+           print("hello")
        assert s.getvalue() == "hello"
     """
     import io
diff --git a/Lib/test/test_tokenize.py b/Lib/test/test_tokenize.py
index 371e2b9..ea9030b 100644
--- a/Lib/test/test_tokenize.py
+++ b/Lib/test/test_tokenize.py
@@ -89,7 +89,7 @@
     >>> roundtrip("try: import somemodule\\n"
     ...           "except ImportError: # comment\\n"
     ...           "    print('Can not import' # comment2\\n)"
-    ...           "else:   print 'Loaded'\\n")
+    ...           "else:   print('Loaded')\\n")
     True
 
 Balancing continuation