Update README.md
This commit is contained in:
@@ -25,11 +25,9 @@ You also need a working version of the latest [Cython](http://cython.org/) insta
|
|||||||
At the moment, there is no documenation, but the library is almost a 1:1 clone of the [Capnproto C++ Library](http://kentonv.github.io/capnproto/cxx.html)
|
At the moment, there is no documenation, but the library is almost a 1:1 clone of the [Capnproto C++ Library](http://kentonv.github.io/capnproto/cxx.html)
|
||||||
|
|
||||||
The examples has one example that shows off the capabilities quite nicely. Here it is, reproduced:
|
The examples has one example that shows off the capabilities quite nicely. Here it is, reproduced:
|
||||||
|
```python
|
||||||
import os
|
|
||||||
import capnp
|
import capnp
|
||||||
this_dir = os.path.dirname(__file__)
|
addressbook = capnp.load('addressbook.capnp')
|
||||||
addressbook = capnp.load(os.path.join(this_dir, 'addressbook.capnp'))
|
|
||||||
|
|
||||||
def writeAddressBook(fd):
|
def writeAddressBook(fd):
|
||||||
message = capnp.MallocMessageBuilder()
|
message = capnp.MallocMessageBuilder()
|
||||||
@@ -85,3 +83,4 @@ The examples has one example that shows off the capabilities quite nicely. Here
|
|||||||
|
|
||||||
f = open('example', 'r')
|
f = open('example', 'r')
|
||||||
printAddressBook(f.fileno())
|
printAddressBook(f.fileno())
|
||||||
|
```
|
||||||
|
|||||||
Reference in New Issue
Block a user