python - Pythonnet TypeError:没有方法匹配给定的参数
问题描述
我在C#
使用pythonnet
.
我已经加载了dll
文件,当我调用一个函数时,我收到了 -
TypeError: No method matches given arguments for Connect: (<class 'System.UInt64'>, <class 'System.String'>, <class 'System.String'>, <class 'int'>, <class 'System.UInt32'>)
serv = String('121.0.0.1:111')
login = UInt64(1)
empty_string = String(' ')
password = String('password')
time_out = UInt32(1)
cmt = CIMTAdminAPI
pump_mode = cmt.EnPumpModes.PUMP_MODE_MAIL
print(pump_mode)
print(serv)
print(login)
print(password)
print(empty_string)
print(time_out)
connection_serv = cmt.Connect
print(connection_serv)
connection_serv[String, UInt64, String, String, cmt.EnPumpModes, UInt32](serv, login, password, empty_string, pump_mode, time_out)
我尝试过不同的事情要做。但总是收到相同的结果。
这些是我需要提出的价值观
Connect(System.String, UInt64, System.String, System.String, EnPumpModes, UInt32)
控制台的完整输出
4
121.0.0.1:111
1
password
1
<unbound method 'Connect'>
Traceback (most recent call last):
File "C:\Users\anton\PycharmProjects\work_projects\pynet.py", line 26, in <module>
connection_serv[String, UInt64, String, String, cmt.EnPumpModes, UInt32](serv, login, password, empty_string, pump_mode, time_out)
TypeError: No match found for given type params
解决方案
推荐阅读
- php - 在 woocommerce 中,每十个产品赠送一份免费礼物
- flutter - Flutter flutter/CMakeLists.txt "#" 这个字符是不允许的
- python - 如何将值列表插入到python中列的空值中?
- python - 我在使用 post 方法时遇到了一些问题,我得到了 {"detail":"Method Not Allowed"}
- html - 如何在html中添加正确的文件路径
- python - 如何在桑基图中对节点进行排序(Plotly)
- javascript - appendchild 在这个日历中是如何工作的?
- wordpress - 我想在我的 WP 网站上添加一个功能,仅使用标题的前 3 个字符生成 slug。有谁知道怎么做?
- jolt - 空元素的颠簸转换问题
- wpf - ListView 扩展器在过滤器搜索上重置