我使用的是python-chess modal Input: list 'pre‘,其中包含:'e2e4','e7e5’
for x in range(0, len(pre)-1):
move=chess.Move.from_uci(str(pre[x]))
print(move)
board.push_san(move())
print(board)
错误: TypeError: push_san()缺少1个必需的位置参数:'san‘
对解决这个问题有什么想法吗?thx
发布于 2021-06-29 17:46:37
试试这个:
for x in pre: #range(0, len(pre)-1) is useless
move=chess.Move.from_uci(x). #str() is useless : pre contains only strings
print(move)
board.push_san(move) # move, not move()
print(board)https://stackoverflow.com/questions/64977837
复制相似问题