Q on explicitly calling file.close

MRAB python at mrabarnett.plus.com
Wed Sep 9 23:10:01 CEST 2009


r wrote:
[snip]
> #-- Double Extra Creidit --#
> Create a backup_file() function that takes <filename> as arg and
> creates a copy of the file with the extension ".bak"...
>>>> backup_file('C:\test.txt') -> 'C:\test.bak'
> 
You should've used raw strings. :-)



More information about the Python-list mailing list