2

my goal is to get the updates of an rtd server in python

I've following call in excel which is working:

=RTD("xrtd.xrtd";;"EUCA")

For python I've found following client library: https://github.com/brotchie/pyrtd/blob/master/rtd/client.py

I tried to get a simple example where I can connect to the server

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))

My first problem was that I've used 64bit python, but after I solved this I receive following exception from the connect():

xrtd.xrtd error : This COM object can not automate the makepy process

  • please run makepy manually for this object

I've no idea what I've to do now. I've python experience but no experience with COM Objects

Hunk
  • 479
  • 11
  • 33

1 Answers1

0

Try this

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')
bigbounty
  • 16,526
  • 5
  • 37
  • 65
  • Thank you for the answer, but this isn't the problem. I got an exception from the connect function – Hunk Jul 19 '20 at 07:30
  • Does this help - https://stackoverflow.com/questions/47985956/how-to-use-com-from-python-win32com-or-comtypes-to-access-an-irtdserver? – bigbounty Jul 19 '20 at 07:42