Robert Rawlins - Think Blue wrote:
> I have a byte array passed to me by dbus and I'm looking to convert it into
> a string? Is that possible? Sorry for seeming like a putts with these
> questions, I'm not used to all these complex data types :-D
> 
> dbus.Array([dbus.Byte(54), dbus.Byte(0), dbus.Byte(24), dbus.Byte(9),
> dbus.Byte(0), dbus.Byte(0), dbus.Byte(10), dbus.Byte(0), dbu
> s.Byte(0), dbus.Byte(0), dbus.Byte(0), dbus.Byte(9), dbus.Byte(0),
> dbus.Byte(1), dbus.Byte(53), dbus.Byte(3), dbus.Byte(25), dbus.
> Byte(16), dbus.Byte(0), dbus.Byte(9), dbus.Byte(2), dbus.Byte(0),
> dbus.Byte(53), dbus.Byte(3), dbus.Byte(9), dbus.Byte(1), dbus.By
> te(1)], signature=dbus.Signature('y'))

No idea, but what happens when you iterate over it?

for i in array_thingy:
   print i

Or does it support the buffer interface?

for i in buffer (array_thingy):
   print i

If it did then you can at least get access to its
innards and construct some kind of string representation.
I've no idea what the numbers are supposed to represent,
so I don't know what "convert it to a string" is likely
to imply. This looks rather more like a dbus question than
a strictly Python one. Is there a DBus mailing list or
what-have-you?

TJG
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to