2to3 处理一下就可以在 py3.5 上运行了。。。
```
kiritsugu@KIRITSUGU-PC C:\Python35\Tools\scripts
$ 2to3 -w C:\Users\kiritsugu\Desktop\FlappyFrog-master\
flappy.pyRefactoringTool: Skipping optional fixer: buffer
RefactoringTool: Skipping optional fixer: idioms
RefactoringTool: Skipping optional fixer: set_literal
RefactoringTool: Skipping optional fixer: ws_comma
RefactoringTool: Refactored C:\Users\kiritsugu\Desktop\FlappyFrog-master\
flappy.py--- C:\Users\kiritsugu\Desktop\FlappyFrog-master\
flappy.py (original)
+++ C:\Users\kiritsugu\Desktop\FlappyFrog-master\
flappy.py (refactored)
@@ -175,7 +175,7 @@
# adjust playery, playerIndex, basex
if (loopIter + 1) % 5 == 0:
- playerIndex = playerIndexGen.next()
+ playerIndex = next(playerIndexGen)
loopIter = (loopIter + 1) % 30
basex = -((-basex + 4) % baseShift)
playerShm(playerShmVals)
@@ -262,7 +262,7 @@
# playerIndex basex change
if (loopIter + 1) % 3 == 0:
- playerIndex = playerIndexGen.next()
+ playerIndex = next(playerIndexGen)
loopIter = (loopIter + 1) % 30
basex = -((-basex + 100) % baseShift)
@@ -442,8 +442,8 @@
x1, y1 = rect.x - rect1.x, rect.y - rect1.y
x2, y2 = rect.x - rect2.x, rect.y - rect2.y
- for x in xrange(rect.width):
- for y in xrange(rect.height):
+ for x in range(rect.width):
+ for y in range(rect.height):
if hitmask1[x1+x][y1+y] and hitmask2[x2+x][y2+y]:
return True
return False
RefactoringTool: Files that were modified:
RefactoringTool: C:\Users\kiritsugu\Desktop\FlappyFrog-master\
flappy.py```