The problem is in this line:
>>> xls = ExcelFile('C:\RWFC\test.xls')
The backward slash has a special meaning. For example, the character "\t" in a normal string is the tab character:
>>> "\t"
'\t'
>>> len("\t")
1
That's why in your error message:
IOError: [Errno 22] invalid mode ('rb') or filename: 'C:\\RWFC\test.xls'
You see a double slash in front of the R
-- \R
doesn't have any special meaning, and so it knew you meant one "real" slash:
>>> s = "\\"
>>> s
'\\'
>>> print s
\
>>> len(s)
1
but \t
does have a special meaning. To solve this problem you can either use a "raw string", and add "r" before the string literal:
>>> "C:\RWFC\test.xls"
'C:\\RWFC\test.xls'
>>> r"C:\RWFC\test.xls"
'C:\\RWFC\\test.xls'
or, you can simply use forward slashes instead -- which Windows supports -- and avoid all the trouble:
>>> "C:/RWFC/test.xls"
'C:/RWFC/test.xls'
Either way should work.