python怎么调用函数的返回值_如何从python调用的CAPL函数中获取返回值?

AI助手已提取文章相关产品:

我想从python调用的CAPL函数中获取返回数据。

请帮我拿这个。在

目前我只能调用示例中带参数的函数。在from win32com import client

import pythoncom

import time

function1 = None

canoe_app = None

is_running = False

class EventHandler:

def OnInit(self):

global canoe_app

global function1

function1 = canoe_app.CAPL.GetFunction('Test1')

def OnStart(self):

global is_running

is_running = True

canoe_app = client.Dispatch('CANoe.Application')

measurement = canoe_app.Measurement

measurement_events = client.WithEvents(measurement, EventHandler)

measurement.Start()

# The following loop takes care of any pending events and, once, the Measurement

# starts, it will call the CAPL function "function1" 10 times and then exit!

count = 0

while count < 10:

if (is_running):

ret = []

function1.Call(count)

function1.Call(count+1)

print(ret)

count += 1

pythoncom.PumpWaitingMessages()

time.sleep(1)

measurement.Stop()

您可能感兴趣的与本文相关内容

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值