file = open(path,'wb')?????

jubafre at jubafre at
Mon Sep 23 20:52:07 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+' ')

 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??

AHM 0020 0000x7 0030 0000x8 0010 0000x9 00F0 0003 0002 0000 

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

Juliano Freitas

More information about the Python-list mailing list