aboutsummaryrefslogtreecommitdiff
path: root/testSGF.py
diff options
context:
space:
mode:
Diffstat (limited to 'testSGF.py')
-rwxr-xr-xtestSGF.py20
1 files changed, 20 insertions, 0 deletions
diff --git a/testSGF.py b/testSGF.py
new file mode 100755
index 0000000..08a1bee
--- /dev/null
+++ b/testSGF.py
@@ -0,0 +1,20 @@
+#!/usr/bin/python
+
+"""Gets a game from an SGF file."""
+
+import sys
+
+from imago.sgfParser.sgf import loadGameTree
+
+def main():
+ filename = sys.argv[1]
+ move = loadGameTree(filename)
+ while move is not None:
+ move.printBoard()
+ if len(move.nextMoves) > 0:
+ move = move.nextMoves[0]
+ else:
+ move = None
+
+if __name__ == '__main__':
+ main()