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: Philippe Michel
Subject: Re: Tools to convert xg file format to sgf
Date: Sat, 15 Oct 2022 22:34:54 +0200

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]