Created
April 19, 2023 15:01
-
-
Save magickatt/936d2290b54d74f0f0864ccdf025a966 to your computer and use it in GitHub Desktop.
Show GMP (GNU MP Bignum Library) version using Python
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# https://stackoverflow.com/a/22981757 | |
import ctypes | |
so_name='/usr/lib64/libgmp.so.10' # or /usr/lib/libgmp.so, etc | |
var_name='__gmp_version' | |
L=ctypes.cdll.LoadLibrary(so_name) | |
v=ctypes.c_char_p.in_dll(L,var_name) | |
print(v.value) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment