I have a long list that looks like this:
[True, True, True, False, ... ]
Representation of walls in a tile map. It is not guaranteed that it will be a multiple of 4 long, but it does not matter whether it will be supplemented at the end.
I would like to convert this to a hexadecimal string, so in the example above it will start with E ...
I was hoping there was a nice elegant way to do this (using Python 2.7.3)!
Thanks.
edited
This is an example of a 9x9 card:
map = [True, True, True, True, True, True, True, True, True, True, True, True, True, False, False, True, True, True, True, True, True, False, False, False, False, True, True, True, True, True, False, False, False, False, True, True, True, True, True, True, False, False, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True]# False, False, False padded
I would like to be able
str = heximify(map) print str > FFF9F87C3F3FFFFFFFFF8