Python ctypes: loading DLL from from a relative path

前端 未结 4 1652
挽巷
挽巷 2020-12-15 04:40

I have a Python module, wrapper.py, that wraps a C DLL. The DLL lies in the same folder as the module. Therefore, I use the following code to load it:



        
4条回答
  •  感情败类
    2020-12-15 05:18

    You can use os.path.dirname(__file__) to get the directory where the Python source file is located.

提交回复
热议问题