yep, i noticed. ;^)
no prob, through your help, it is working the way i needed.
thanks
>> print "[%s]" % ('-'.join([hex(v) for v in theValue]) )
> Oops, that leaves 0x at the front of each byte.
> You could strip that off with
> print "[%s]" % ('-'.join([hex(v)[2:] for v in theValue]) )
> print "[%s]" % ('-'.join([hex(v) for v in theValue]) )
Oops, that leaves 0x at the front of each byte.
You could strip that off with
print "[%s]" % ('-'.join([hex(v)[2:] for v in theValue]) )
Sorry,
Alan G.
___
Tutor maillist - Tutor@python.o
thanks,
def conv_tst(bytes)
return ('-'.join([binascii.hexlify(v) for v in bytes]))
i ended up experimenting with the suggestions and the above returns what i'm
looking for, i.e., the formatted mac addr to store in a sqlite db.
i'm sure there are other ways, though the abov
Hello Alan,
> First please start new threads wirth a new email, do not reply to
thought i did, my apologies.
> "eMyListsDDg" wrote
> First please start new threads wirth a new email, do not reply to
> a previous post - it confuses threaded readers. (and sometimes
> human readers too!)
>
Steve,
glad you pointed that out.
struct.unpack or something...i'll look into that module.
thx
> On 14-Jul-10 11:35, eMyListsDDg wrote:
>> '\x00\x11\xb2\x00@,O\xa4'
>> the above str is being returned from one key/value pair in a dictionary. it
>> is the addr of a network device.
>> i
"eMyListsDDg" wrote
First please start new threads wirth a new email, do not reply to
a previous post - it confuses threaded readers. (and sometimes
human readers too!)
'\x00\x11\xb2\x00@,O\xa4'
the above str is being returned from one key/value pair in
a dictionary. it is the addr of a
On 14-Jul-10 11:35, eMyListsDDg wrote:
'\x00\x11\xb2\x00@,O\xa4'
the above str is being returned from one key/value pair in a dictionary. it is
the addr of a network device.
i want to store the addr's in their 8byte mac format like this,
[00 11 b2 00 40 2C 4F A4]
the combinations of