Ben Cartwright wrote: > Actually, it creates a new string instance with the \n character > removed, then discards it. The original switches[0] string hasn't > changed. > Yes. You are repeated assigning a new string instance to "line", which > is then never referenced again.
Ah, thank you! > PS - actually, you can accomplish all of the above in a single line of > code: > print [line[:-1] for line in open('C:\\switches.txt')] Wow, that just replaced 7 lines of code! So *this* is why Python is good. :) -- http://mail.python.org/mailman/listinfo/python-list