All Samples(41) | Call(39) | Derive(0) | Import(2)
Pack the values v1, v2, ... according to fmt. Write the packed bytes into the writable buffer buf starting at offset.
src/i/t/itrackutil-HEAD/trunk/lib/read_atmel.py itrackutil(Download)
else:
idle = 0xff
struct.pack_into('<LLB',data,0,timestep, diststep, sens)
struct.pack_into('<BBBBB',data,24,tag, vmin, idle,0,8) # No idea what 0, 8 means
for w in wavfiles:
src/i/t/itrackutil-HEAD/lib/read_atmel.py itrackutil(Download)
else:
idle = 0xff
struct.pack_into('<LLB',data,0,timestep, diststep, sens)
struct.pack_into('<BBBBB',data,24,tag, vmin, idle,0,8) # No idea what 0, 8 means
for w in wavfiles:
src/p/y/pypy3-HEAD/pypy/lib/array.py pypy3(Download)
array(typecode [, initializer]) -- create a new array """ from struct import calcsize, pack, pack_into, unpack_from import operator # the buffer-like object to use internally: trying from
if not (0 <= i < seqlength):
raise IndexError(i)
boundary = i * self.itemsize
pack_into(self.typecode, self._data, boundary, x)
def __setslice__(self, i, j, x):
self.__setitem__(slice(i, j), x)
def _fromiterable(self, iterable):
iterable = tuple(iterable)
n = len(iterable)
boundary = len(self._data)
newdata = bytebuffer(boundary + n * self.itemsize)
newdata[:boundary] = self._data
pack_into('%d%s' % (n, self.typecode), newdata, boundary, *iterable)
src/p/y/pypy-HEAD/lib_pypy/array.py pypy(Download)
array(typecode [, initializer]) -- create a new array """ from struct import calcsize, pack, pack_into, unpack_from import operator # the buffer-like object to use internally: trying from
if not (0 <= i < seqlength):
raise IndexError(i)
boundary = i * self.itemsize
pack_into(self.typecode, self._data, boundary, x)
def __setslice__(self, i, j, x):
self.__setitem__(slice(i, j), x)
def _fromiterable(self, iterable):
iterable = tuple(iterable)
n = len(iterable)
boundary = len(self._data)
newdata = bytebuffer(boundary + n * self.itemsize)
newdata[:boundary] = self._data
pack_into('%d%s' % (n, self.typecode), newdata, boundary, *iterable)
src/j/y/jython-HEAD/sandbox/tobias/jython/CPythonLib/test/test_struct.py jython(Download)
def test_pack_into_fn():
test_string = 'Reykjavik rocks, eow!'
writable_buf = array.array('c', ' '*100)
fmt = '21s'
pack_into = lambda *args: struct.pack_into(fmt, *args)
# Test without offset.
src/j/y/jython-HEAD/sandbox/wierzbicki/test27/Lib/test/test_struct.py jython(Download)
def test_pack_into_fn():
test_string = 'Reykjavik rocks, eow!'
writable_buf = array.array('c', ' '*100)
fmt = '21s'
pack_into = lambda *args: struct.pack_into(fmt, *args)
# Test without offset.
src/j/y/jython-HEAD/sandbox/tobias/jython/Lib/test/test_struct.py jython(Download)
def test_pack_into_fn():
test_string = 'Reykjavik rocks, eow!'
writable_buf = array.array('c', ' '*100)
fmt = '21s'
pack_into = lambda *args: struct.pack_into(fmt, *args)
# Test without offset.
src/j/y/jython-HEAD/sandbox/wierzbicki/test27/CPythonLib/test/test_struct.py jython(Download)
def test_pack_into_fn(self):
test_string = 'Reykjavik rocks, eow!'
writable_buf = array.array('c', ' '*100)
fmt = '21s'
pack_into = lambda *args: struct.pack_into(fmt, *args)
# Test without offset.
src/j/y/jython-HEAD/jython/CPythonLib/test/test_struct.py jython(Download)
def test_pack_into_fn():
test_string = 'Reykjavik rocks, eow!'
writable_buf = array.array('c', ' '*100)
fmt = '21s'
pack_into = lambda *args: struct.pack_into(fmt, *args)
# Test without offset.
src/j/y/jython-HEAD/jython/Lib/test/test_struct.py jython(Download)
def test_pack_into_fn():
test_string = 'Reykjavik rocks, eow!'
writable_buf = array.array('c', ' '*100)
fmt = '21s'
pack_into = lambda *args: struct.pack_into(fmt, *args)
# Test without offset.
1 | 2 | 3 | 4 Next