Error writing binary file in Python -


i have python program receives binary file via parameter , writes file in directory. when writes file, characters program replaces series of numbers. below original file program receives parameter:

**Ðt_Ö/¤Ð樮kmµûÀz”Ô(Î,“+œd¼es¥** 

but when program writes, @ result:

**Ðt_Ö/¤Ð樮kmµûÀz &#148 ; Ô(Î, &#147 ; &#156 ;d¼es¥** 

you can see character between characters z , Ô replaced sequence &#148 ;. caracter "+" between characters Î, , œd replaced sequence &#147

below python program code leitiura , recording binary file

import subprocess subprocess import popen, pipe, stdout def chamaprog(arquivo):     var_file = open("c:\\nitgen\\arquivo.rec","wb")    conteudo_texto = var_file.write(arquivo)    var_file.close()  

why happening? should read , write characters correctly?


Comments

Popular posts from this blog

angularjs - ADAL JS Angular- WebAPI add a new role claim to the token -

php - CakePHP HttpSockets send array of paramms -

node.js - Using Node without global install -