-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Description
Hi, your library was very useful to me. I was able to take pictures with my code but I was having a lot of unexpected errors and the docs didn't help me so much. Your code works great!
However, I think you're using python 3, because with Python 2 your code is incompatible. The solution is to change the following calls:
- int.from_bytes --->
def __from_bytes(self, bytes):
return int(bytes.encode('hex'), 16)
- int.to_bytes -->
def __to_bytes(self, n, length, byteorder='big'):
h = '%x' % n
s = ('0'*(len(h) % 2) + h).zfill(length*2).decode('hex')
return s if byteorder == 'big' else s[::-1]
Good job!
Metadata
Metadata
Assignees
Labels
No labels