slicing the end of a string in a list

John Salerno johnjsal at NOSPAMgmail.com
Mon Mar 6 10:03:00 EST 2006


Paul Rubin wrote:
> John Salerno <johnjsal at NOSPAMgmail.com> writes:
>> Interesting. So I would say:
>>
>> [line.rstrip() for line in open('C:\\switches.txt')]


How would I manually close a file that's been opened this way? Or is it 
not possible in this case? Is it necessary?



More information about the Python-list mailing list