Skip to content

Instantly share code, notes, and snippets.

@magickatt
Created April 19, 2023 15:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save magickatt/936d2290b54d74f0f0864ccdf025a966 to your computer and use it in GitHub Desktop.
Save magickatt/936d2290b54d74f0f0864ccdf025a966 to your computer and use it in GitHub Desktop.
Show GMP (GNU MP Bignum Library) version using Python
# 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