[Tutor] How to convert binary files back to text files?
prasad rao
prasadaraon50 at gmail.com
Sat Aug 29 15:12:54 CEST 2009
>On 8/29/09, Geneviève DIAGORN <gdi at teamlog.com> wrote:
>
> >Bonjour,
> >Je suis absente jusqu'au 02/09 inclus.
> >En cas d'urgence Soprane, contacter notre adresse générique
> >projet.soprane at teamlog.com.
> >Cordialement.
>
> >Geneviève
I dont know your language.Please communicate in English.
I am using the code below to conver string to bin and back.
def tobin(astr):
z=map(lambda x: bin(ord(x)),astr)
return z
def tostring(blist):
z=map(lambda x: chr(int(x,2)),l)
return ''.join(z)
I dont believe it is impossible on files.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/tutor/attachments/20090829/77380dfb/attachment.htm>
More information about the Tutor
mailing list