Created
March 11, 2021 20:52
-
-
Save lewoudar/6617b84d0ca7bdf06604a3a5a454b7c4 to your computer and use it in GitHub Desktop.
Basic example usage of kifurushi
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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