pypot icon indicating copy to clipboard operation
pypot copied to clipboard

Move.load(f) issue in python 3.6

Open show0k opened this issue 8 years ago • 2 comments

Spotted by @pierre-rouanet

import time

from pypot.creatures import PoppyErgoJr
from pypot.primitive.move import MoveRecorder, MovePlayer, Move


if __name__ == '__main__':
    jr = PoppyErgoJr(simulator='poppy-simu')

    mr = MoveRecorder(jr, 50, jr.motors)
    mr.start()
    time.sleep(1)
    mr.stop()

    with open('/tmp/bob.json', 'w') as f:
        mr.move.save(f)

    with open('/tmp/bob.json') as f:
        m = Move.load(f)

    # Fonctionne
    mp = MovePlayer(jr, mr.move)
    mp.start()
    mp.wait_to_stop()
    print('Everything ok')

    # Plante
    mp = MovePlayer(jr, m)
    mp.start()
    mp.wait_to_stop()

show0k avatar Feb 08 '17 11:02 show0k

Only with 3.6 or with all 3.x ? If I remenber well my issue was about playing a move with python 3 : https://github.com/poppy-project/pypot/pull/218

jjehl avatar Feb 08 '17 17:02 jjehl

It is strange, yes it seems to be the same issue but I didn't get this issue for python other python 3 version.

show0k avatar Feb 08 '17 17:02 show0k