Page 1 of 1
Python 3 libraries for Go and GTP?
Posted: Tue Apr 20, 2021 2:52 pm
by MikeKyle
My level of expertise is poor in both but I quite enjoy messing around with go and python.
I want to be able to interact with bots and have found some great code for handling the GTP commands in projects such as:
goreviewpartner
Gomill
twogtp
But I have some Python 3 code that I'd quite like to use without worrying about compatibility.
Are there any libraries or projects written in Python 3 which manage GTP commands?
Or is there a good reason why these projects use Python 2?
Are there any other cool projects I should be aware of?
Re: Python 3 libraries for Go and GTP?
Posted: Wed Apr 21, 2021 7:46 am
by And
twogtp was written in 2007, Python 3 appeared later. but why do goreviewpartner and Gomill use Python 2, this is interesting, can ask the authors?
Re: Python 3 libraries for Go and GTP?
Posted: Wed Apr 21, 2021 1:15 pm
by And
Re: Python 3 libraries for Go and GTP?
Posted: Thu Apr 22, 2021 3:15 am
by MikeKyle
Thanks
And wrote:twogtp was written in 2007, Python 3 appeared later. but why do goreviewpartner and Gomill use Python 2, this is interesting, can ask the authors?
That is a solid excuse for twogtp at least.
Looks like grp was based on Gomill to some extent?
Interesting that SGFmill seems to have branched of Gomill and uses python 3 but looses the GTP handling stuff. That suggests that there are some issues with the gomill GTP code playing nicely with python 3. I've actually been trying to update it myself but it doesn't take long for me to run into issues.
Yes. This looks quite nice. A bit cleaner than the board state representations in other python code maybe.
I was encouraged to notice that Katrain is all python. Then slightly dissapointed to learn that it doesn't use GTP.
Re: Python 3 libraries for Go and GTP?
Posted: Thu Apr 22, 2021 9:44 am
by And
Re: Python 3 libraries for Go and GTP?
Posted: Thu Apr 22, 2021 10:36 am
by And
Re: Python 3 libraries for Go and GTP?
Posted: Thu Apr 22, 2021 8:25 pm
by kferg
I wrote a go game logic library in C++ with a Python wrapper. It should be faster than most pure-Python implementations. It works in Python 3 only:
https://github.com/macfergus/baduk
The documentation is somewhat lacking, sorry. But if you want to try to use I can make an effort to improve the docs.
Probably less useful, but I've also written some GTP driving code as part of a different project; I didn't intend it to be a standalone GTP library, but here it is for completeness:
https://github.com/macfergus/badukai/tr ... adukai/gtp
also Python 3 only
but why do goreviewpartner and Gomill use Python 2, this is interesting, can ask the authors?
In my experience, the transition from Python 2 to Python 3 took a looooong time. Basically, you couldn't upgrade your project until every single library you depend on upgraded. As recently as 2014 I worked at a company that was still starting new projects in Python 2, due to single key dependency.
Re: Python 3 libraries for Go and GTP?
Posted: Fri Apr 23, 2021 4:02 am
by MikeKyle
I have no Russian skills but from the code and some Google translating, I think I can find the right things to look into.
The versions of popen and subprocesses seem critical.
Excellent! Exactly the kind of thing I was hoping for.
kferg wrote:I wrote a go game logic library in C++ with a Python wrapper. It should be faster than most pure-Python implementations. It works in Python 3 only:
https://github.com/macfergus/baduk
The documentation is somewhat lacking, sorry. But if you want to try to use I can make an effort to improve the docs.
Probably less useful, but I've also written some GTP driving code as part of a different project; I didn't intend it to be a standalone GTP library, but here it is for completeness:
https://github.com/macfergus/badukai/tr ... adukai/gtp
also Python 3 only
Excellent. These tools look really nice. I will try them out now.
Docs aren't critically important IMO because the code is really clear and concise. I think I could roughly follow everything in each repo within a couple of minutes.
Docs might help more people find it though which seems like a good thing.
kferg wrote:
In my experience, the transition from Python 2 to Python 3 took a looooong time. Basically, you couldn't upgrade your project until every single library you depend on upgraded. As recently as 2014 I worked at a company that was still starting new projects in Python 2, due to single key dependency.
That's understandable, especially for larger scale projects.
I find it a bit unusual for these small go projects though as they seem to have so few dependencies.
Thanks both. That's so much more useful stuff than I expected