User Tools

Site Tools


python-usage

The Python binding is available for both Python2 (tested with version 2.7 only) and Python3 (tested with version 3.4). The examples on this page require that you first [[python-install|build and install the Python binding]] on your system. ======== Run the simple example ======== An example is provided in ''contrib/python/example.py''. You may execute it to exercise the Python binding:<code> $ python ./contrib/python/example.py 10 create a stream of RTP packets 10 60-byte RTP packets created with 20-byte payload create ROHC compressor create ROHC decompressor .......... all 10 packets were successfully compressed 232 bytes (39%) saved by compression</code> The example program accepts additional options to make it more verbose:<code> $ python ./contrib/python/example.py 10 usage: example.py packets_number [verbose [verbose]]</code> If you specify ''verbose'' once, the program prints more information for every packets it compresses then decompresses. If you specify ''verbose'' twice, the program prints ROHC library traces for every packets it compresses then decompresses. ======== Run the Python's non-regression test ======== The non-regression was re-implemented in Python. It is useful to fully test the Python binding. <code> $ USE_PYTHON=2.7 make -C test/non_regression/ check # for Python 2.7 $ USE_PYTHON=3.4 make -C test/non_regression/ check # for Python 3.4</code>

python-usage.txt · Last modified: 2016/01/11 19:55 by didier