Sign in
android-kvm
/
buildroot
/
cc7ccd2ae25125991e7ec00c7d3fd46a5de57b3c
/
.
/
support
/
testing
/
tests
/
package
/
sample_python_cbor_enc.py
blob: 31d937d4b891a92c2a892398d100119597f00be1 [
file
] [
log
] [
blame
]
import
cbor
data
=
{
"name"
:
"python-cbor"
,
"versions"
:
[
"1"
,
"2"
],
"group"
:
{
"is_a_package"
:
True
,
"value"
:
42
}
}
serialized
=
cbor
.
dumps
(
data
)
print
(
serialized
.
decode
(
errors
=
"ignore"
))
with
open
(
"/tmp/data.cbor"
,
"wb"
)
as
f
:
f
.
write
(
serialized
)