On Tue, Oct 13, 2015 at 1:37 AM, Michiel Overtoom <mot...@xs4all.nl> wrote:
> Hi,
>
>> excel_book=Excel.Workbooks.Open('D:\WebPython\Config3.xlsx')
>
> Shouldn't this be:
>
>     excel_book=Excel.Workbooks.Open('D:\\WebPython\\Config3.xlsx')
> or
>     excel_book=Excel.Workbooks.Open(r'D:\WebPython\Config3.xlsx')
> ?

Ideally yes, but in this case it's the same. \W is an unrecognized
escape sequence, so it represents REVERSE SOLIDUS followed by LATIN
CAPITAL LETTER W. (IMO this is a misfeature in Python. I'd prefer
unrecognized escapes to trigger SyntaxError, so people don't get
confused when they change to "C:\Users\fred" and it changes in
meaning.)

ChrisA
-- 
https://mail.python.org/mailman/listinfo/python-list

Reply via email to