[Tutor] end of line character seems to be invisible. why?
Kermit Rose
kermit at polaris.net
Wed Jun 7 04:05:17 CEST 2006
I ran the program
# inp = open("CMT_MCAID", "rb")
# out = open("mcaid.txt", "w")
# for I in range(1,1000):
# if I I%60=== 0:
# out.write('\n')
# ch = inp.read(1)
# if not ch: break # EOF
# k = ord(ch) # convert to integer
# kl = k % 16
# kh = k / 16
# out.write('%d %d ' % (kh, kl))
# out.close()
I added the lines
# if I%60 == 0:
# out.write('\n')
because the output was one long line, and I wanted to be able to see the
output when
I opened the file with notepad.
I expected that it would break the line at every 60 characters.
It made no difference. The output file is still one long line.
Kermit < kermit at polaris.net >
More information about the Tutor
mailing list