From: Mick S. <mi...@su...> - 2020-10-14 13:08:55
|
I had a bit of trouble with this and thought it worth sharing the solution. With Python2 and pyownet I could use owp.write('/settings/timeout/directory', 60) but with Python3 that throws an error, TypeError: 'data' argument must be binary. I can use owp.write('/settings/timeout/directory', b'60') but if I want to use a variable for the data the format which works is - x = 60 owp.write('/settings/timeout/directory', bytes(str.encode(str(x)))) There may be other ways to do it but that works for me. Mick |