Writing hex data into a file,f.write(chr(i))