python调用qt编写的dll

报错:FileNotFoundError: Could not find module 'F:\pythonProject\MINGW\sgp4Lib.dll' (or one of its dependencies). Try using the full path with constructor syntax.

只有两种情况:

1.路径不对

2.库的依赖不全

1、如果是使用了qt库的,必须将所有依赖项拷贝到Python工程中。

方法1:使用depends walker

方法2:使用windeployqt.exe 打包 找到所有依赖项。结果可能很大 ,可以试着删掉一些不需要的,删了,不影响正常调用dll,就是可以删掉的。

python 复制代码
import ctypes



# Press the green button in the gutter to run the script.
if __name__ == '__main__':
    print(platform.architecture())
    dll = ctypes.cdll.LoadLibrary(r'F:/pythonProject/MINGW/xxxLib.dll')#

如果返回json格式,可以参考如下:

qt:

Python:

相关推荐
2401_8246976612 小时前
如何实现SQL存储过程状态监控_编写实时运行监控仪表盘
jvm·数据库·python
iAm_Ike12 小时前
c++怎么在写入文件流时通过peek预读功能实现复杂的逻辑判断【实战】
jvm·数据库·python
dFObBIMmai12 小时前
mysql如何确保主从数据完全同步_开启半同步复制机制
jvm·数据库·python
才兄说12 小时前
机器人二次开发机器狗巡检?长距离最优路径
python
铅笔小新z12 小时前
【C语言】数据类型和变量
c语言·开发语言
code_whiter13 小时前
C++11(stack和queue)
开发语言·c++
m0_4708576413 小时前
CSS如何实现Bootstrap进度条自定义动画_利用keyframe关键帧
jvm·数据库·python
nashane13 小时前
HarmonyOS 6学习:Navigation Dialog模式与智能Web长截图融合实践
人工智能·pytorch·python
最后一支迷迭香13 小时前
苹果的MacOS系统适合做Java开发吗
java·开发语言·macos
m0_7390300013 小时前
[特殊字符] Java 高频面试题汇总
java·开发语言·面试