Hello,
how i can write binary data to file:
f=open('c:\\a.bin','wb')
f.write(chr(254))
f.close()
i get error ASCII decoding error
and how find binary data in binary file ?
Hello,
how i can write binary data to file:
f=open('c:\\a.bin','wb')
f.write(chr(254))
f.close()
i get error ASCII decoding error
and how find binary data in binary file ?
Last edited by valdonas; 2009-03-31 at 07:56.
As it says, it has a problem with decoding 254. Non-printable character?
Works with other simple values,
Try this,
Refer to the ASCII character map,Code:f=open('c:\\a.bin','wb') f.write(chr(2)) #write ? f.close()
http://www.danshort.com/ASCIImap/
//Croozeus
Pankaj Nathani
www.croozeus.com
and how i can write to file all characters ?