Chadwick Gambit: Software Tools for Game Theory

pygambit.gambit.Game.read_game#

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

Construct a game from its serialised representation in a file.

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.