Python中的RTD客户端
我的目标是用python更新rtd服务器 我在excel中进行了以下调用,该调用正在运行:Python中的RTD客户端,python,excel,rtd,Python,Excel,Rtd,我的目标是用python更新rtd服务器 我在excel中进行了以下调用,该调用正在运行: =RTD("xrtd.xrtd";;"EUCA") 对于python,我发现了以下客户端库: 我试图得到一个简单的例子,我可以连接到服务器 import sys sys.path.append(".") from client import RTDClient name = "xrtd.xrtd" try: cl
=RTD("xrtd.xrtd";;"EUCA")
对于python,我发现了以下客户端库:
我试图得到一个简单的例子,我可以连接到服务器
import sys
sys.path.append(".")
from client import RTDClient
name = "xrtd.xrtd"
try:
client = RTDClient(name)
client.connect(False)
client.register_topic('EUCA')
except Exception as identifier:
print(str(name) + " error : " + str(identifier))
我的第一个问题是我使用了64位python,但解决了这个问题后,我从connect()收到了以下异常:
xrtd.xrtd错误:此COM对象无法自动执行makepy过程
- 请为此对象手动运行makepy
import pythoncom
from rtd import RTDClient
if __name__ == '__main__':
time = RTDClient('xrtd.xrtd')
time.connect()
time.register_topic('EUCA')
while 1:
pythoncom.PumpWaitingMessages()
if time.update():
print time.get('EUCA')
谢谢你的回答,但这不是问题所在。我从connect函数中得到了一个异常,这是否有帮助-?无论对谁来说,这个库都是用
python2
编写的,我已经将这个库移植到了python3,只是做了一些修改