Comments (12)
As always, thanks for reporting!
(1) I forgot with-statement support for the Pure Python fallback. Fixed: 83cf049.
(2) Something got cut off that FEN. Fixed: b18ad43.
(3) Usage in Python is just the same. Pure Python fallbacks should automatically be used if the library is not installed in the system.
from python-chess.
(2)
still a "-" missing ;-)
(3)
Yes, i know..I want it to be forced to use or fail. Its for my learning, ha
from python-chess.
(2) 😳
(3) If you really want that, you can use the undocumented open_tablebases_native
. It was mostly intended for testing, but I can see how it might be generally useful. That said: The pure Python probing is not so bad and only slightly slower.
from python-chess.
i mean, tell me how to call it. Im too stupid.
def open_tablebases_native(directory, libgtb=None, LibraryLoader=ctypes.cdll):
what to put for "libgtb", and esp(!) for "LL"?
from python-chess.
The defaults should usually* be fine. Just ignore them ;)
Edit: * on normal Linux/Unix systems. On Windows you might have to compile a DLL and use ctypes.windll
as the library loader.
from python-chess.
du verstehst mich irgendwie nicht...Bei mir ist es nicht DEFAULT, weinen
I want to call the lib without installing it first. Its somewhere in the software tree and has another name (to make it 100% clear and complex). Now, how to tell him to use this one?
Jürgen (der noch nie eine C-Funktion von Python aus aufgerufen hat ,ha)
from python-chess.
D.h. du hast nicht make install
ausgeführt, sondern nur mit make
die Bibliothek compiliert? In dem Fall müsstest du den Pfad zur Bibliothek in einer Umgebungsvariable hinterlegen.
export LD_LIBRARY_PATH="/path/to/the/directory/with/libgtb/:${LD_LIBRARY_PATH}"
Man kann leider nicht einfach in Python den absoluten Pfad zur Bibliothek angeben.
make install
würde dagegen die Bibliothek nach /usr/local/lib
kopieren, wo sie von alleine gefunden werden sollte.
Das mit dem anderen Namen hab ich noch vergessen. Das ist keine gute Idee. Wenn es sein muss, kannst du den im libgtb
Argument übergeben.
from python-chess.
bei mir würde es so gehen:
import chess.gaviota
import ctypes
l = '../Gaviota-Tablebases/libjp.so'
p = './data/gaviota'
c = ctypes.cdll.LoadLibrary(l)
print(c)
with chess.gaviota.NativeTablebases(p, c) as tablebases:
x = tablebases.probe_dtm(chess.Board("8/8/8/8/8/8/8/K2kr3 w - - 0 1"))
print(x)
das ist ja auch nur ein TEST (zum Lernen)...keine Sorge, so würde ich diese lib nicht verwenden ;-)
from python-chess.
Passt vom Prinzip her. Mich wundert, dass es mit dem relativen Pfad in l
klappt.
from python-chess.
Noch ein Nachtrag: Falls das mit dem with
unpraktisch ist, geht natürlich auch immer
tablebases = chess.gaviota.open_tablebases_native(p, l)
# ...
tablebases.close()
from python-chess.
aha.
Nun, ich muss C-Funktionen aufrufen aus Python. Und den Python Teil kupfere ich von anderen ab (habe vorhin http://stackoverflow.com/questions/5081875/ctypes-beginner gefunden).
Hat nun garnix mit deiner Gaviota zu tun (außer das es hier schon funktioniert). Deshalb war ich auch froh, das ich 2 Fehler gefunden hatte, ha....Für Hilfe fragen ist nun nicht gerade python-chess-issues gedacht.
Thanks & Close
from python-chess.
(Bugfix in v0.12.5
enthalten.)
from python-chess.
Related Issues (20)
- getting `chess.IllegalMoveError` despite the fact that move is legal HOT 5
- always castling rights for clean_castling_rights()
- Incorrect perft(4) with Kiwipete. HOT 3
- impossible to get the moves in san format after pushing the move
- [feature request] add `board.san_move_stack` similar to `board.move_stack` to get san format moves HOT 1
- Is this expected or simply a bug? HOT 1
- Using limit(mate=mate) terminates search before mate HOT 3
- Exception in callback Protocol._line_received('') HOT 1
- CancelledError and TimeoutError when using multithreaded Stockfish to analyze certain sequence of board positions. HOT 5
- Feature request: new argument for chess.svg.board() HOT 2
- engine.analyse() exits with TimeoutError exception HOT 2
- Parsing a database with `read_game` results in roughly 2 extra results per game
- `illegal san` error message when the first game in a database contains a move in the White or Black header HOT 4
- Illegal san, but legal uci move leading to two black kings? HOT 1
- epd parser issue when given a fen HOT 1
- en passant target square not populated when pawn moves 2 sqares HOT 2
- How to communicate with a remote chess engine? HOT 6
- Lichess WDL HOT 1
- Encourage/simplify using the last completed score instead of lowerbound/upperbound
- `chess.pgn.read_headers` inserts empty header entries related to newlines and empty movetext HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from python-chess.