kopia lustrzana https://github.com/micropython/micropython-lib
14 wiersze
272 B
Python
14 wiersze
272 B
Python
![]() |
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)
|