tkinter吧 关注:127贴子:364
  • 0回复贴,共1

Python,CANoe,tkinter

只看楼主收藏回复

用CANoe自带的python脚本self.application = win32com.client.DispatchEx("CANoe.Application")打开CANoe工程文件。但是在用python 自带GUI tkinter的时候通过点击一个button关联函数用线程的方式threading.Thread(target=func, args=args)去循环给CANoe发信号值会得到如下错误:pywintypes.com_error: (-2147417842, 'The application called an interface that was marshalled for a different thread.', None, None
自己看了下感觉是CANoe本身在一个线程了,又用其他新的线程去改之前线程的信号值所以会返回这个错误。也不知道是否理解正确,有无高手帮忙指点一把,不胜感激!!


IP属地:上海1楼2021-02-09 09:31回复