Skip to content

Instantly share code, notes, and snippets.

@lewoudar
Created March 11, 2021 20:52
Show Gist options
  • Save lewoudar/6617b84d0ca7bdf06604a3a5a454b7c4 to your computer and use it in GitHub Desktop.
Save lewoudar/6617b84d0ca7bdf06604a3a5a454b7c4 to your computer and use it in GitHub Desktop.
Basic example usage of kifurushi
import enum
from kifurushi import Packet, ShortField, ByteField, IntEnumField
class Mood(enum.Enum):
happy = 1
cool = 2
angry = 4
class Disney(Packet):
__fields__ = [
ShortField('mickey', 2),
ByteField('minnie', 3, hex=True),
IntEnumField('donald', 1, Mood)
]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment