parse this directory path without losing slash
- by PPTim
hi,
I have a wxPython application. I am taking in a directory path from a textbox using GetValue().
I notice that while trying to parse in the directory path
"C:\Documents and Settings\UserName\Desktop\InputFile.xls",
python sees the string as
'C:\\Documents and Settings\UserName\\Desktop\\InputFile.xls' (missing a slash between "Settings" and "UserName).
Why is it that only that slash is not correctly escaped? Once the string has been changed to 'C:\Documents and Settings\UserName\Desktop\InputFile.xls', is there a type conversion or function that can does this properly? Thanks.