Getting started as a lib user now works :)
This commit is contained in:
parent
24758fbaa9
commit
fa0751790e
15
README.md
15
README.md
|
@ -1,9 +1,16 @@
|
|||
A teeworlds network protocol library, designed according to sans I/O (http://sans-io.readthedocs.io/) principles
|
||||
|
||||
## install
|
||||
|
||||
```bash
|
||||
pip install twnet_parser
|
||||
```
|
||||
|
||||
## sample usage
|
||||
|
||||
```python
|
||||
packet = parse(b'\x04\x0a\x00\xcf\x2e\xde\x1d\04') # 0.7 close
|
||||
import twnet_parser.packet
|
||||
packet = twnet_parser.packet.parse(b'\x04\x0a\x00\xcf\x2e\xde\x1d\04') # 0.7 close
|
||||
|
||||
print(packet) # => <class: 'TwPacket'>: {'version': '0.7', 'header': <class: 'Header'>, 'messages': [<class: 'CtrlMessage'>]}
|
||||
print(packet.header) # => <class: 'Header'>: {'flags': <class: 'PacketFlags7, 'size': 0, 'ack': 10, 'token': b'\xcf.\xde\x1d', 'num_chunks': 0}
|
||||
|
@ -12,12 +19,6 @@ for msg in packet.messages:
|
|||
print(msg.name) # => close
|
||||
```
|
||||
|
||||
## install
|
||||
|
||||
```bash
|
||||
pip install twnet_parser
|
||||
```
|
||||
|
||||
## development setup
|
||||
|
||||
```bash
|
||||
|
|
Loading…
Reference in a new issue