Life In 19x19
http://www.lifein19x19.com/

Python 3 libraries for Go and GTP?
http://www.lifein19x19.com/viewtopic.php?f=18&t=18168
Page 1 of 1

Author:  MikeKyle [ Tue Apr 20, 2021 2:52 pm ]
Post subject:  Python 3 libraries for Go and GTP?

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?

Author:  And [ Wed Apr 21, 2021 7:46 am ]
Post subject:  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?

Author:  And [ Wed Apr 21, 2021 1:15 pm ]
Post subject:  Re: Python 3 libraries for Go and GTP?

maybe it's interesting https://github.com/aigagror/GymGo

Author:  MikeKyle [ Thu Apr 22, 2021 3:15 am ]
Post subject:  Re: Python 3 libraries for Go and GTP?

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.

And wrote:
maybe it's interesting https://github.com/aigagror/GymGo


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.

Author:  And [ Thu Apr 22, 2021 9:44 am ]
Post subject:  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

Author:  And [ Thu Apr 22, 2021 10:36 am ]
Post subject:  Re: Python 3 libraries for Go and GTP?

frisbee-twogtp (python3) https://github.com/jmoudrik/frisbee-two ... -twogtp.py

Author:  kferg [ Thu Apr 22, 2021 8:25 pm ]
Post subject:  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

Quote:
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.

Author:  MikeKyle [ Fri Apr 23, 2021 4:02 am ]
Post subject:  Re: Python 3 libraries for Go and GTP?

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


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.

And wrote:


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

Page 1 of 1 All times are UTC - 8 hours [ DST ]
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
http://www.phpbb.com/