I recently found the following in a bit of #python sample code:
random_data = random.sample(string.hexdigits, 8)
hexdigits? I’d use
string.ascii_lowercase before, but this was the first time I’d seen
hexdigits, which is exactly what you’d think:
The string ‘0123456789abcdefABCDEF’.