[Tutor] escape codes and filenames

Steve Spicklemire steve@spvi.com
Sat, 25 Nov 2000 16:12:27 -0500 (EST)


Hi Roger,

   Hmm... something is really wierd!

I cooked up the following code:

----------------------------------------------------------------------

f = open('foo.txt')

lines = f.readlines()

for line in lines:
    print `line`

----------------------------------------------------------------------

I saved the following in foo.txt

C:\__test\dir1\xray.htm
C:\__test\dir1\1234.htm
C:\__test\dir2\fred.htm
C:\__test\dir2\apex_declaration_class.htm

When I run my code I get:

'C:\\__test\\dir1\\xray.htm\012'
'C:\\__test\\dir1\\1234.htm\012'
'C:\\__test\\dir2\\fred.htm\012'
'C:\\__test\\dir2\\apex_declaration_class.htm\012'

Which is exactly what I expect....  what do you get?

-steve

>>>>> "RM" == Mallett, Roger <rmallett@rational.com> writes:

    RM> Steve, Richard,

    RM> Steve asked: "How did you get filelist?"