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 ” ; Ô(Î, “ ; œ ;d¼es¥**
you can see character ” between characters z , Ô replaced sequence ” ;. caracter "+" between characters Î, , œd replaced sequence “
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
Post a Comment