20210904
- upload to pypi finally, you can install Python3 version by
pip3 install pysproto
20170313
- Add fixed-point number support
- Add unicode string support, any field with declare string must be unicode, and it will send out with utf-8 encoded. If you encoded string yourself, then use binary instead
The sproto_decode api has changed recently, so you may need to change the code to accept ret value. Sorry for the inconvenient.
First, you need a sproto compiler to compile sproto description to binary description. You can do it offline with sproto_dump. Then you can use sproto decode and encode interface.
withopen('your.spb', 'r') asfh: content=fh.read() sproto_obj=SprotoRpc(content, content, base_package) #base_package is your package struct namep=sproto_obj.request('client.hello',{'foo':'bar'}) sock.send(p)all error is in pysproto.error
python setup.py build Then copy the example.so from build directory to python script directory.
Python2.7 supported
Python2.6 is not supported currently