pygambit.gambit.Game.to_nfg#

Game.to_nfg(filepath_or_buffer: str | Path | IOBase | None = None) str | None#

Save the game to a .nfg file or return its serialized representation

Parameters:

filepath_or_buffer (str or Path or BufferedWriter or None, default None) – String, path object, or file-like object implementing a write() function. If None, the result is returned as a string.

Return type:

String representation of the game or None if the game is saved to a file

See also

to_efg, to_html, to_latex