bug-gnubg
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Tools to convert xg file format to sgf


From: Turker Eflanli
Subject: Re: Tools to convert xg file format to sgf
Date: Sat, 15 Oct 2022 17:20:04 -0400

Awesome, great idea, thanks! 

On Sat, Oct 15, 2022 at 4:35 PM Philippe Michel <philippe.michel7@free.fr> wrote:
On Sat, Oct 15, 2022 at 12:55:36PM -0400, Turker Eflanli wrote:

> It just parses the file, with the python scripts [...]

If you're familiar with python you could consider using gnubg's internal
python interpreter (accessed with a ">" in gnubg's CLI).

For instance you could try something like this to get an idea of what it
makes available when you load an analyzed match:

gnubg.command("load match xxx.sgf")

match = gnubg.match()

for game in match.get("games"):
    for action in game.get("game"):
        print("======");
        print(action);

The match object is somewhat complex but will still be much easier to
use than starting from the raw sgf file.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]