Python 3 fixes

This commit is contained in:
cclauss
2018-10-17 01:48:46 +02:00
parent 1697ee1c43
commit 6a8e87e17b
13 changed files with 140 additions and 116 deletions

View File

@@ -1,3 +1,4 @@
from __future__ import print_function
import string, random, os, re, bisect
"""Produce Panama-ish Palindromes. Copyright (C) 2002, Peter Norvig.
@@ -127,7 +128,7 @@ class Panama:
"Write current state to log file."
if len(self) > self.best + 200:
self.best = len(self)
print self.best
print(self.best)
self.bestphrase = str(self)
assert is_panama(self.bestphrase)
f = open('pallog%d.txt' % os.getpid(), 'w')