Mercurial
comparison mrjunejune/main.py @ 41:d2bb317e01db
[Experiment] Calling seobeo in a python server and see.
| author | MrJuneJune <me@mrjunejune.com> |
|---|---|
| date | Mon, 01 Dec 2025 20:58:04 -0800 |
| parents | |
| children |
comparison
equal
deleted
inserted
replaced
| 40:9b8521f75409 | 41:d2bb317e01db |
|---|---|
| 1 from cffi import FFI | |
| 2 import os | |
| 3 | |
| 4 ffi = FFI() | |
| 5 ffi.cdef("void start_server(void);") | |
| 6 | |
| 7 # Bazel runs binaries from a sandbox, so use runfiles to locate the .so | |
| 8 import pathlib | |
| 9 runfiles_dir = pathlib.Path(__file__).parent | |
| 10 libpath = runfiles_dir / "mrjunejune_server_so.so" | |
| 11 | |
| 12 C = ffi.dlopen(str(libpath)) | |
| 13 C.start_server() | |
| 14 |