loading
 
python 3.1
joerg from Germany  [4 posts]
14 year
i have no problems using python 2.6 as a control program for RR, but some trouble switching to python 3.1:

changing the API lines:
        ...
        raise RuntimeError, "socket connection broken"
        ...
        print data
        ...        
to:
        ...
        raise RuntimeError("socket connection broken")
        ...
        print (data)
        ...

allows in python 3.1:

from RR_API import *
RR=RR_API()
RR.Connect("localhost")

but:

RR.GetVariable("FPS")

leads to an error:

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "C:\Programme\Python\lib\site-packages\RR_API.py", line 114, in GetVariab
le
    self.sock.send("<request><get_variable>"+str(name)+"</get_variable></request
>")
TypeError: must be bytes or buffer, not str

any python expert, who can help me?

regards
Joerg
  
Anonymous 14 year
Sorry Joerg.  I have encountered the same problems and stuck with 2.6 for just this reason.  

If you want to see a project (to which a joerg contributed BTW) making use of the python API look at:
http://profmason.com/?p=1084

This forum thread has been closed due to inactivity (more than 4 months) or number of replies (more than 50 messages). Please start a New Post and enter a new forum thread with the appropriate title.

 New Post   Forum Index