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?
Python 3 libraries for Go and GTP?
-
And
- Gosei
- Posts: 1464
- Joined: Tue Sep 25, 2018 10:28 am
- GD Posts: 0
- Has thanked: 212 times
- Been thanked: 215 times
Re: Python 3 libraries for Go and GTP?
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?
- MikeKyle
- Lives with ko
- Posts: 205
- Joined: Wed Jul 26, 2017 2:27 am
- Rank: EGF 2k
- GD Posts: 0
- KGS: MKyle
- Has thanked: 49 times
- Been thanked: 36 times
Re: Python 3 libraries for Go and GTP?
Thanks 
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.
I was encouraged to notice that Katrain is all python. Then slightly dissapointed to learn that it doesn't use GTP.
That is a solid excuse for twogtp at least.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?
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.And wrote:maybe it's interesting https://github.com/aigagror/GymGo
I was encouraged to notice that Katrain is all python. Then slightly dissapointed to learn that it doesn't use GTP.
-
And
- Gosei
- Posts: 1464
- Joined: Tue Sep 25, 2018 10:28 am
- GD Posts: 0
- Has thanked: 212 times
- Been thanked: 215 times
Re: Python 3 libraries for Go and GTP?
differences between os.popen2 and subprocess.Popen, solution in go_assistant program (Russian)
https://www.sql.ru/forum/1254184/python ... cess-popen
https://github.com/zztrilobit/go_assist ... r/goban.py
https://www.sql.ru/forum/1254184/python ... cess-popen
https://github.com/zztrilobit/go_assist ... r/goban.py
-
And
- Gosei
- Posts: 1464
- Joined: Tue Sep 25, 2018 10:28 am
- GD Posts: 0
- Has thanked: 212 times
- Been thanked: 215 times
Re: Python 3 libraries for Go and GTP?
frisbee-twogtp (python3) https://github.com/jmoudrik/frisbee-two ... -twogtp.py
Re: Python 3 libraries for Go and GTP?
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
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
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.but why do goreviewpartner and Gomill use Python 2, this is interesting, can ask the authors?
- MikeKyle
- Lives with ko
- Posts: 205
- Joined: Wed Jul 26, 2017 2:27 am
- Rank: EGF 2k
- GD Posts: 0
- KGS: MKyle
- Has thanked: 49 times
- Been thanked: 36 times
Re: Python 3 libraries for Go and GTP?
I have no Russian skills but from the code and some Google translating, I think I can find the right things to look into.And wrote:differences between os.popen2 and subprocess.Popen, solution in go_assistant program (Russian)
https://www.sql.ru/forum/1254184/python ... cess-popen
https://github.com/zztrilobit/go_assist ... r/goban.py
The versions of popen and subprocesses seem critical.
Excellent! Exactly the kind of thing I was hoping for.And wrote:frisbee-twogtp (python3) https://github.com/jmoudrik/frisbee-two ... -twogtp.py
Excellent. These tools look really nice. I will try them out now.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
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.
That's understandable, especially for larger scale projects.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.
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