[Tutor] Opening text file
Daniel Yoo
dyoo@hkn.eecs.berkeley.edu
Sun, 5 Nov 2000 12:51:22 -0800 (PST)
On Sat, 4 Nov 2000, Jon Cosby wrote:
> This is strange. I have a text file named "count.dat" that consists of
> one line, an integer. Each time I open it in Python, several new blank
> lines are added, ending with a "Tf". It happens when I open and close
> the file in the interpreter, nothing else. Can somebody tell me what's
> going on here?
This is weird! Could you show us an example output, as well as
count.dat? As a first guess, if you created count.dat on a different
system (like a Macintosh or UNIX), then it's possible that you're seeing
the result of a slightly different text file format.
In UNIX, newlines are represented as the string "\n", while on Windows
platforms, it's "\r\n". However, I've never seen "Tf" before.