mirror of
https://github.com/Farama-Foundation/Gymnasium.git
synced 2025-08-22 07:02:19 +00:00
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:
@@ -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()
|
||||
|
Reference in New Issue
Block a user