A chess library for Python, with move generation and validation, PGN parsing and writing, Polyglot opening book reading, Gaviota tablebase probing, Syzygy tablebase probing, and UCI/XBoard engine communication
Hi, Im having a problem with the PGN module. This code gives me an error telling that tell() attribute doesn't exists.
AttributeError: module 'chess.pgn' has no attribute 'tell'
import chess
import chess.pgn
with open(test, 'r') as pgn_file:
while True:
offset = chess.pgn.tell()
game = chess.pgn.read_headers(pgn_file)
if not game:
break
But this code works fine which means that the PGN module is imported:
import chess
import chess.pgn
with open(test, 'r') as pgn_file:
while True:
# offset = chess.pgn.tell()
game = chess.pgn.read_headers(pgn_file)
if not game:
break
UPDATE
The only functions available are:
skip_game(handle: TextIO) -> boolread_headers(handle: TextIO) -> Optional[Headers]read_game(handle: TextIO) -> Optional[Game]
Hi, Im having a problem with the PGN module. This code gives me an error telling that
tell()
attribute doesn't exists.AttributeError: module 'chess.pgn' has no attribute 'tell'
But this code works fine which means that the PGN module is imported:
UPDATE The only functions available are:
skip_game(handle: TextIO) -> bool
read_headers(handle: TextIO) -> Optional[Headers]
read_game(handle: TextIO) -> Optional[Game]
Library: chess 1.10.0 pyhd8ed1ab_1 conda-forge