pygambit.gambit.Game.write#
- Game.write(format='native') str#
Produce a serialization of the game.
Several output formats are supported, depending on the representation of the game.
efg: A representation of the game in the .efg extensive game file format. Not available for games in strategic representation.
nfg: A representation of the game in the .nfg strategic game file format. For an extensive game, this uses the reduced strategic form representation.
native: The format most appropriate to the underlying representation of the game, i.e., efg or nfg.
This method also supports exporting to other output formats (which cannot be used directly to re-load the game later, but are suitable for human consumption, inclusion in papers, and so on).
html: A rendering of the strategic form of the game as a collection of HTML tables. The first player is the row chooser; the second player the column chooser. For games with more than two players, a collection of tables is generated, one for each possible strategy combination of players 3 and higher.
sgame: A rendering of the strategic form of the game in LaTeX, suitable for use with Martin Osborne’s sgame style. The first player is the row chooser; the second player the column chooser. For games with more than two players, a collection of tables is generated, one for each possible strategy combination of players 3 and higher.
Changed in version 16.3.0: Removed support for writing Game Theory Explorer format as the XML format is no longer supported by recent versions of GTE.
Deprecated since version 16.3.0: Method Game.write is deprecated, use one of the respective methods instead:
Game.to_efg,Game.to_nfg,Game.to_html,Game.to_latex
