Convertir une liste en hexa en python ... Sauvegarder Signaler H25 - Dernière réponse le 25 nov. 2011 1 réponse Bonjour, je suis débutant en Python. comment convertir une liste de chaine de caracteres en hexa ? merci :) Afficher la suite 1 réponse Trié par votes Votes Date Date décroissante Réponse 1 / 1 ... Signaler heyquem bonsoir, for c in 'abcd': o = ord(c) print c,o print hex(o),type(hex(o)) print print ''.join(hex(ord(c)) for c in 'abcd') résultat: a 97 0x61 <type 'str'> b 98 0x62 <type 'str'> c 99 0x63 <type 'str'> d 100 0x64 <type 'str'> 0x610x620x630x64 Discussions similaires m3 en m2 : comment convertir ? valou Comment convertir des m3 en m2 ? Citronelle Combien 1m3 pour 1m2 angieb92 comment transformer gpx en pdf chector11 Sujet Précédent Sujet Suivant
Réponse 1 / 1 ... Signaler heyquem bonsoir, for c in 'abcd': o = ord(c) print c,o print hex(o),type(hex(o)) print print ''.join(hex(ord(c)) for c in 'abcd') résultat: a 97 0x61 <type 'str'> b 98 0x62 <type 'str'> c 99 0x63 <type 'str'> d 100 0x64 <type 'str'> 0x610x620x630x64