Files
mongo/lang/python/wiredtiger/packing-test.py
Michael Cahill 1fb70757f2 Fix "make install" of Python. Remove old code and restructure the Python sources under lang/python to simplify the installation step.
--HG--
rename : lang/python/fpacking.py => lang/python/wiredtiger/fpacking.py
rename : lang/python/intpack-test.py => lang/python/wiredtiger/intpack-test.py
rename : lang/python/intpacking.py => lang/python/wiredtiger/intpacking.py
rename : lang/python/packing-test.py => lang/python/wiredtiger/packing-test.py
rename : lang/python/packing.py => lang/python/wiredtiger/packing.py
2013-07-17 10:13:11 +10:00

18 lines
417 B
Python

#!/usr/bin/env python
#
# Copyright (c) 2008-2013 WiredTiger, Inc.
# All rights reserved.
#
# See the file LICENSE for redistribution information.
from packing import pack, unpack
def check(fmt, *v):
print fmt, repr(v), ''.join('%02x' % ord(c) for c in pack(fmt, *v))
check('iii', 0, 101, -99)
check('3i', 0, 101, -99)
check('iS', 42, "forty two")
check('u', r"\x42" * 20)
check('uu', r"\x42" * 10, r"\x42" * 10)