kopia lustrzana https://github.com/micropython/micropython-lib
struct: Start more compliant struct module implementation than ustruct.
rodzic
c63f0a1da3
commit
190eaad67f
|
@ -0,0 +1,13 @@
|
||||||
|
from ustruct import *
|
||||||
|
|
||||||
|
class Struct:
|
||||||
|
|
||||||
|
def __init__(self, format):
|
||||||
|
self.format = format
|
||||||
|
self.size = calcsize(format)
|
||||||
|
|
||||||
|
def unpack(self, buf):
|
||||||
|
return unpack(self.format, buf)
|
||||||
|
|
||||||
|
def pack(self, *vals):
|
||||||
|
return pack(self.format, *vals)
|
Ładowanie…
Reference in New Issue