pygambit.gambit.Game.read_game#

classmethod Game.read_game(filepath: str | Path) Game#

Construct a game from its serialised representation in a file.

Deprecated since version 16.3.0: Method Game.read_game is deprecated, use one of the respective functions instead: read_gbt, read_efg, read_nfg, read_agg

Parameters:

filepath (str or path object) – The path to the file containing the game representation.

Returns:

A game constructed from the representation in the file.

Return type:

Game

Raises:
  • IOError – If the file cannot be opened or read

  • ValueError – If the contents of the file are not a valid game representation.

See also

parse_game

Constructs a game from a text string.