我正在使用 win32com.client 编写一个小插件,但是我在设置属性时遇到了问题。属性或函数的定义如下:
[id(0x00000021), propget, helpstring("property SystemChannel")]
long SystemChannel(
long lVEN,
long lDEV,
long lSVID,
long lSID);
[id(0x00000021), propput, helpstring("property SystemChannel")]
void SystemChannel(
long lVEN,
long lDEV,
long lSVID,
long lSID,
[in] long rhs);
我没有获得价值的问题,下一个代码工作得很好:
app = Dispatch("CmAVConfig.AudioConfig")
self.speakerNumber = app.SystemChannel(self.glVid, self.glDid, self.glSvid, self.glsid)
但我无法设置相同属性的值,我尝试使用以下说明,但出现以下错误:
app = Dispatch("CmAVConfig.AudioConfig")
app.SystemChannel(self.glVid, self.glDid, self.glSvid, self.glsid, self.speakerNumber)
ERROR: SystemChannel() takes at most 5 arguments (6 given)
//this one is from a working example using javascript
app.SystemChannel(self.glVid, self.glDid, self.glSvid, self.glsid) = self.speakerNumber
ERROR: SyntaxError: ("can't assign to function call", ('ooo.py', 56, None, 'app.SystemChannel(self.glVid, self.glDid, self.glSvid, self.glsid) = self.speakerNumber\n'))