Francois De Serres wrote: > hiho, > > what's the clean way to translate the tuple (0x73, 0x70, 0x61, 0x6D) to > the string 'spam'?
Use ''.join and chr() as others have pointed out. Here are just-for-fun versions ;) .>>> t = (0x73, 0x70, 0x61, 0x6D) (use string formatter): .>>> '%c%c%c%c' % t 'spam' (use struct model): .>>> import struct .>>> struct.pack('bbbb', *t) 'spam' -- Qiangning Hong I'm usually annoyed by IDEs because, for instance, they don't use VIM as an editor. Since I'm hooked to that, all IDEs I've used so far have failed to impress me. -- Sybren Stuvel @ c.l.python Get Firefox! <http://www.spreadfirefox.com/?q=affiliates&id=67907&t=1> -- http://mail.python.org/mailman/listinfo/python-list