G
Greg Smethells
What exactly does "*values" mean in the following code? Is this a
pointer to a PyList? Why can I not find good documentation on this any
where? I must be blind:
More importantly still, how would you write the same code in C? If you
wanted to instead call struct_pack(PyObject *tuple), what would the
tuple look like in C?
Thanks to anyone who can clear all this up for me.
Greg
pointer to a PyList? Why can I not find good documentation on this any
where? I must be blind:
from struct import *
format = "dl"
values = [3.14, 42]
foo = pack(format, *values)
foo '\x1f\x85\xebQ\xb8\x1e\t@*\x00\x00\x00'
unpack(format, foo) (3.1400000000000001, 42)
More importantly still, how would you write the same code in C? If you
wanted to instead call struct_pack(PyObject *tuple), what would the
tuple look like in C?
Thanks to anyone who can clear all this up for me.
Greg