writing in a file as binary mode????

jubafre at brturbo.com jubafre at brturbo.com
Mon Sep 23 15:40:42 EDT 2002


i open the a file for writing in a binary mode, but doesnt work

final3=['0020 0000x9', '0030 0000xa', '00B4 0000x8', '0030 0000xb', '00F0', '0001', '0003', '0005']
destino=raw_input("Digite o nome do arquivo .mem: ")
f = open(destino,'wb')
f.write('\x03AHM ')
for i in final3:
    f.write(i+' ')
f.close()


just the "f.write('\x03AHM ')" work, i open the file in the notepad and my file appears like a text file and not as a binary file, i dont know why??

>>file.mem
AHM 0020 0000x7 0030 0000x8 0010 0000x9 00F0 0003 0002 0000 

>>i have the file like this, how??
AHM  € 0   ƒ ð 




Juliano Freitas
www.gebrasil.hpg.com.br 


More information about the Python-list mailing list