xkenneth wrote: > I want to be able to cycle through an array and print something in > hexadecimal. Such as this > thisArray = ["AF","0F","5F"] > for x in range(len(thisArray)): > print "\x" + thisArray[x] > > However python chokes on the escaped identifier, how can I get around > this? > > Thanks! > Regards, > Ken > > If you have things in a list you can iterate through the list much easier:
thisArray = ["AF","0F","5F"] for item in thisArray: print item In this array you store strings, so if you want to print stuff out in hex you need to give python integers, so let's say you have a list of integers: thisArray = [256,512,1024] for item in thisArray: print "%x"%item That will print those integers in hex. -carl -- Carl J. Van Arsdall [EMAIL PROTECTED] Build and Release MontaVista Software -- http://mail.python.org/mailman/listinfo/python-list