TypeError: decoding str is not supported

前端 未结 1 1853
刺人心
刺人心 2021-02-20 00:34

Im trying to make a attribute characteristic randomiser for my nephews board game and I\'m trying to write the attributes to an external file so that he can use them later. when

1条回答
  •  走了就别回头了
    2021-02-20 00:47

    Not sure about what you expect str('Speed -', str(speed)) to do.

    What you want is a string concat:

    speedE2 = 'Speed -' + str(speed)
    # replace other lines also
    

    You can also use string formatting and not worry about type casts:

    speedE2 = 'Speed -{}'.format(speed)
    

    0 讨论(0)
提交回复
热议问题