diff options
Diffstat (limited to 'Lib/test/sortperf.py')
-rw-r--r-- | Lib/test/sortperf.py | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/Lib/test/sortperf.py b/Lib/test/sortperf.py index 3c95b89..205ff87 100644 --- a/Lib/test/sortperf.py +++ b/Lib/test/sortperf.py @@ -38,7 +38,7 @@ def randfloats(n): except os.error: pass except IOError as msg: - print "can't write", fn, ":", msg + print("can't write", fn, ":", msg) else: result = marshal.load(fp) fp.close() @@ -60,7 +60,7 @@ def doit(L): t0 = time.clock() L.sort() t1 = time.clock() - print "%6.2f" % (t1-t0), + print("%6.2f" % (t1-t0), end=' ') flush() def tabulate(r): @@ -84,11 +84,11 @@ def tabulate(r): """ cases = tuple([ch + "sort" for ch in r"*\/3+%~=!"]) fmt = ("%2s %7s" + " %6s"*len(cases)) - print fmt % (("i", "2**i") + cases) + print(fmt % (("i", "2**i") + cases)) for i in r: n = 1 << i L = randfloats(n) - print "%2d %7d" % (i, n), + print("%2d %7d" % (i, n), end=' ') flush() doit(L) # *sort L.reverse() @@ -137,7 +137,7 @@ def tabulate(r): # significantly faster if we leave tham as ints. L = map(float, L) doit(L) # !sort - print + print() def main(): """Main program when invoked as a script. |