Fix Python3 compatibility in Go env (#64)

Under Python3, user inputs are in string format and needs be
converted
into bytes before passing to pachi-py. The returned __repr__ from
pachi-py for the boards are bytes and needs be converted into string
for
line breaks to work.

Also fixed raw_input and print functions in play_go under
examples/scripts with six package.
This commit is contained in:
Shu Shen
2016-05-09 19:18:55 -07:00
committed by Greg Brockman
parent a20719c8e3
commit 168f25b976
2 changed files with 5 additions and 4 deletions

View File

@@ -1,4 +1,5 @@
#!/usr/bin/env python
from six.moves import input as raw_input
import argparse
import pachi_py
import gym
@@ -28,8 +29,8 @@ def main():
break
print
print 'You win!' if r > 0 else 'Opponent wins!'
print 'Final score:', env._state.board.official_score
print('You win!' if r > 0 else 'Opponent wins!')
print('Final score:', env._state.board.official_score)
if __name__ == '__main__':
main()