push_san() missing 1 required positional argument: 'san'

344 views Asked by At

I am using the python-chess modal Input: list called 'pre' containing: ['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)

The error: TypeError: push_san() missing 1 required positional argument: 'san'

Any ideas on fixing this issue? thx

1

There are 1 answers

0
LittleCoder On BEST ANSWER

Try this :

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)