Lucas wrote: > well, if I just open the file in binary mode, and write a string,e.g > '660', how do i read the result? I means I need print the binary in > screen.
I'm afraid that the more you write, the less sense you make. > do these? > > fileWrite = open('a.jpg','ab') > fileWrite.write('660') > fileWrite.close() > > fileRead = open('a.jpg','rb') > b = fileRead.read() > fileRead.close() > print b that prints three bytes, "6", "6", and "0": >>> fileWrite = open('a.jpg','ab') >>> fileWrite.write('660') >>> fileWrite.close() >>> fileRead = open('a.jpg','rb') >>> b = fileRead.read() >>> fileRead.close() >>> print b 660 what do you want it to print ? </F> -- http://mail.python.org/mailman/listinfo/python-list