Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--gtp.py11
1 files changed, 11 insertions, 0 deletions
diff --git a/gtp.py b/gtp.py
index 5e7164a..98a500a 100644
--- a/gtp.py
+++ b/gtp.py
@@ -19,8 +19,19 @@
from subprocess import Popen, PIPE
import logging
+from os.path import exists, join, abspath
+from os import pathsep, environ
+from string import split
+
logger = logging.getLogger('PlayGo')
+def search_for_gnugo():
+ paths = split(environ['PATH'], pathsep)
+ for path in paths:
+ if exists(join(path, 'gnugo')):
+ return abspath(join(path, 'gnugo'))
+ return False
+
class gnugo:
''' A wrapper for talking to gnugo over GTP '''
def __init__(self, boardsize=19, color='black', handicap=0, komi=5.5, level=3):