struct: Start more compliant struct module implementation than ustruct.

pull/26/head
Paul Sokolovsky 2015-05-08 00:54:25 +03:00
rodzic c63f0a1da3
commit 190eaad67f
1 zmienionych plików z 13 dodań i 0 usunięć

13
struct/struct.py 100644
Wyświetl plik

@ -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)