I have a demand to load all dynamic libraries given in a directory.
ctypes gives me the capability of loading a dynamic library without considering the prefix and suffix of a library file.
However I don’t know if there’s an existing API to load all dynamic libraries in a directory, or just provide me a value to indicate the suffix of a dynamic library.
Any suggestions?
Can I do this in Python without implementing the functionalities myself? I don’t want to do this
The one I’m aware of is importlib.machinery.all_suffixes(). It’s not exactly what you are looking for, but it returns all of the suffixes Python looks for when importing. e.g. *.py, *.pyc, *.so